mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 22:13:26 +00:00
zerver/lib: Remove u prefix from strings.
This commit is contained in:
@@ -312,7 +312,7 @@ class S3UploadBackend(ZulipUploadBackend):
|
||||
bucket = settings.S3_AVATAR_BUCKET
|
||||
medium_suffix = "-medium.png" if medium else ""
|
||||
# ?x=x allows templates to append additional parameters with &s
|
||||
return u"https://%s.s3.amazonaws.com/%s%s?x=x" % (bucket, hash_key, medium_suffix)
|
||||
return "https://%s.s3.amazonaws.com/%s%s?x=x" % (bucket, hash_key, medium_suffix)
|
||||
|
||||
def upload_realm_icon_image(self, icon_file: File, user_profile: UserProfile) -> None:
|
||||
content_type = guess_type(icon_file.name)[0]
|
||||
@@ -342,7 +342,7 @@ class S3UploadBackend(ZulipUploadBackend):
|
||||
def get_realm_icon_url(self, realm_id: int, version: int) -> Text:
|
||||
bucket = settings.S3_AVATAR_BUCKET
|
||||
# ?x=x allows templates to append additional parameters with &s
|
||||
return u"https://%s.s3.amazonaws.com/%s/realm/icon.png?version=%s" % (bucket, realm_id, version)
|
||||
return "https://%s.s3.amazonaws.com/%s/realm/icon.png?version=%s" % (bucket, realm_id, version)
|
||||
|
||||
def ensure_medium_avatar_image(self, user_profile: UserProfile) -> None:
|
||||
file_path = user_avatar_path(user_profile)
|
||||
@@ -393,7 +393,7 @@ class S3UploadBackend(ZulipUploadBackend):
|
||||
bucket = settings.S3_AVATAR_BUCKET
|
||||
emoji_path = RealmEmoji.PATH_ID_TEMPLATE.format(realm_id=realm_id,
|
||||
emoji_file_name=emoji_file_name)
|
||||
return u"https://%s.s3.amazonaws.com/%s" % (bucket, emoji_path)
|
||||
return "https://%s.s3.amazonaws.com/%s" % (bucket, emoji_path)
|
||||
|
||||
|
||||
### Local
|
||||
@@ -455,7 +455,7 @@ class LocalUploadBackend(ZulipUploadBackend):
|
||||
def get_avatar_url(self, hash_key: Text, medium: bool=False) -> Text:
|
||||
# ?x=x allows templates to append additional parameters with &s
|
||||
medium_suffix = "-medium" if medium else ""
|
||||
return u"/user_avatars/%s%s.png?x=x" % (hash_key, medium_suffix)
|
||||
return "/user_avatars/%s%s.png?x=x" % (hash_key, medium_suffix)
|
||||
|
||||
def upload_realm_icon_image(self, icon_file: File, user_profile: UserProfile) -> None:
|
||||
upload_path = os.path.join('avatars', str(user_profile.realm.id), 'realm')
|
||||
@@ -471,7 +471,7 @@ class LocalUploadBackend(ZulipUploadBackend):
|
||||
|
||||
def get_realm_icon_url(self, realm_id: int, version: int) -> Text:
|
||||
# ?x=x allows templates to append additional parameters with &s
|
||||
return u"/user_avatars/%s/realm/icon.png?version=%s" % (realm_id, version)
|
||||
return "/user_avatars/%s/realm/icon.png?version=%s" % (realm_id, version)
|
||||
|
||||
def ensure_medium_avatar_image(self, user_profile: UserProfile) -> None:
|
||||
file_path = user_avatar_path(user_profile)
|
||||
@@ -505,7 +505,7 @@ class LocalUploadBackend(ZulipUploadBackend):
|
||||
|
||||
def get_emoji_url(self, emoji_file_name: Text, realm_id: int) -> Text:
|
||||
return os.path.join(
|
||||
u"/user_avatars",
|
||||
"/user_avatars",
|
||||
RealmEmoji.PATH_ID_TEMPLATE.format(realm_id=realm_id, emoji_file_name=emoji_file_name))
|
||||
|
||||
# Common and wrappers
|
||||
|
||||
Reference in New Issue
Block a user