Skip to content
  • P
    Projects
  • G
    Groups
  • S
    Snippets
  • Help

CIRCLE / cloud

  • This project
    • Loading...
  • Sign in
Go to a project
  • Project
  • Repository
  • Issues 94
  • Merge Requests 10
  • Pipelines
  • Wiki
  • Snippets
  • Members
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Merged
Merge request !191 opened Sep 09, 2014 by Bach Dániel@bachdaniel 
  • Report abuse
Report abuse

Fix Autocomplete

Closes #273 (closed)

  • Discussion 3
  • Commits 8
  • Changes
{{ resolvedDiscussionCount }}/{{ discussionCount }} {{ resolvedCountText }} resolved
  • Őry Máté
    @orymate started a discussion on an old version of the diff Sep 10, 2014
    circle/dashboard/autocomplete_light_registry.py
    15 def choice_html(self, choice):
    17 def highlight(self, field, q, none_wo_match=True):
    18 if not field:
    19 return None
    16 20 try:
    17 name = choice.get_full_name()
    18 except AttributeError:
    19 name = _('group')
    20 if name:
    21 name = u'(%s)' % name
    21 match = field.lower().index(q.lower())
    22 except ValueError:
    23 match = None
    24 if q and match is not None:
    25 match_end = match + len(q)
    26 return (field[:match] + '<span class="autocomplete-hl">' +
    • Őry Máté @orymate commented Sep 10, 2014
      Owner

      isn't this an exploitable xss?

      isn't this an exploitable xss?
    Please register or sign in to reply
  • Őry Máté
    @orymate started a discussion on an old version of the diff Sep 10, 2014
    circle/dashboard/autocomplete_light_registry.py
    29 return None if none_wo_match else field
    30
    31 def choice_displayed_text(self, choice):
    32 q = unicode(self.request.GET.get('q', ''))
    33 name = self.highlight(unicode(choice), q, False)
    34 if isinstance(choice, User):
    35 extra_fields = [self.highlight(choice.get_full_name(), q, False),
    36 self.highlight(choice.email, q)]
    37 try:
    38 extra_fields.append(self.highlight(choice.profile.org_id, q))
    39 except Profile.DoesNotExist:
    40 pass
    41 return '%s (%s)' % (name, ', '.join(f for f in extra_fields
    42 if f))
    43 else:
    44 return '%s (%s)' % (name, _('group'))
    • Őry Máté @orymate commented Sep 10, 2014
      Owner

      _("%s (group)")?

      `_("%s (group)")`?
    Please register or sign in to reply
  • Őry Máté @orymate commented Sep 10, 2014
    Owner

    +1

    +1
  • Write
  • Preview
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment
Bach Dániel
Assignee
Bach Dániel @bachdaniel
Assign to
September
Milestone
September
Assign milestone
Time tracking
0
Labels
None
Assign labels
  • View labels
2
2 participants
Reference: circle/cloud!191