zerver/views: Remove u prefix from strings.

This commit is contained in:
rht
2017-11-04 05:23:22 +01:00
committed by Tim Abbott
parent 2b19f17fc9
commit fae8d23039
3 changed files with 6 additions and 6 deletions

View File

@@ -371,7 +371,7 @@ def finish_google_oauth2(request: HttpRequest) -> HttpResponse:
full_name = body['name']['formatted']
except KeyError:
# Only google+ users have a formatted name. I am ignoring i18n here.
full_name = u'{} {}'.format(
full_name = '{} {}'.format(
body['name']['givenName'], body['name']['familyName']
)
for email in body['emails']:

View File

@@ -179,8 +179,8 @@ class NarrowBuilder:
Escape user input to place in a regex
Python's re.escape escapes unicode characters in a way which postgres
fails on, u'\u03bb' to u'\\\u03bb'. This function will correctly escape
them for postgres, u'\u03bb' to u'\\u03bb'.
fails on, '\u03bb' to '\\\u03bb'. This function will correctly escape
them for postgres, '\u03bb' to '\\u03bb'.
"""
s = list(pattern)
for i, c in enumerate(s):
@@ -398,8 +398,8 @@ class NarrowBuilder:
# whereas the offsets from tsearch_extras are in bytes, so we
# have to account for both cases in the logic below.
def highlight_string(text: Text, locs: Iterable[Tuple[int, int]]) -> Text:
highlight_start = u'<span class="highlight">'
highlight_stop = u'</span>'
highlight_start = '<span class="highlight">'
highlight_stop = '</span>'
pos = 0
result = ''
in_tag = False

View File

@@ -184,7 +184,7 @@ def accounts_register(request: HttpRequest) -> HttpResponse:
default_stream_group_names = request.POST.getlist('default_stream_group')
default_stream_groups = lookup_default_stream_groups(default_stream_group_names, realm)
timezone = u""
timezone = ""
if 'timezone' in request.POST and request.POST['timezone'] in get_all_timezones():
timezone = request.POST['timezone']