Compare commits

...

3 Commits

Author SHA1 Message Date
Jonas Schäfer
7ffcd76cea Handle broken/incorrect avatar metadata gracefully
Fixes #180.
2024-03-10 10:49:29 +01:00
Federico
bda0f52320 Translated using Weblate (Italian)
Currently translated at 100.0% (361 of 361 strings)

Translation: Snikket/Web Portal
Translate-URL: http://i18n.sotecware.net/projects/snikket/web-portal/it/
2024-01-20 23:01:47 +00:00
Matthew Wild
5efc2a671e Merge pull request #177 from snikket-im/feature/fix-requirements
Fix python requirements to actually work
2024-01-16 16:12:37 +00:00
3 changed files with 15 additions and 10 deletions

View File

@@ -120,6 +120,14 @@ class AdminUserInfo:
roles.extend(data.get("secondary_roles", [])) roles.extend(data.get("secondary_roles", []))
except KeyError: except KeyError:
roles = data.get("roles") roles = data.get("roles")
avatar_info: typing.List[AvatarMetadata] = []
for avatar in data.get("avatar_info", []):
# Ignore somehow broken avatars.
try:
avatar_metadata = AvatarMetadata.from_api_response(avatar)
except KeyError:
pass
avatar_info.append(avatar_metadata)
return cls( return cls(
localpart=data["username"], localpart=data["username"],
display_name=data.get("display_name") or None, display_name=data.get("display_name") or None,
@@ -131,10 +139,7 @@ class AdminUserInfo:
deletion_request=UserDeletionRequestInfo.from_api_response( deletion_request=UserDeletionRequestInfo.from_api_response(
data.get("deletion_request") data.get("deletion_request")
), ),
avatar_info=[ avatar_info=avatar_info,
AvatarMetadata.from_api_response(avatar_info)
for avatar_info in data.get("avatar_info", [])
],
) )

View File

@@ -6,12 +6,12 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PROJECT VERSION\n" "Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" "Report-Msgid-Bugs-To: translations@snikket.org\n"
"POT-Creation-Date: 2024-01-08 22:58+0000\n" "POT-Creation-Date: 2024-01-08 22:58+0000\n"
"PO-Revision-Date: 2024-01-04 10:17+0000\n" "PO-Revision-Date: 2024-01-20 23:01+0000\n"
"Last-Translator: Roberto Resoli <roberto@resolutions.it>\n" "Last-Translator: Federico <federico@tebaldi.eu>\n"
"Language-Team: Italian <http://i18n.sotecware.net/projects/snikket/web-" "Language-Team: Italian <http://i18n.sotecware.net/projects/snikket/"
"portal/it/>\n" "web-portal/it/>\n"
"Language: it\n" "Language: it\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
@@ -779,7 +779,7 @@ msgstr "Elimina la chat di gruppo %(name)s"
#: snikket_web/templates/admin_edit_circle.html:61 #: snikket_web/templates/admin_edit_circle.html:61
msgid "This circle currently has no group chats." msgid "This circle currently has no group chats."
msgstr "Al momento questa cerchia non chat di gruppo." msgstr "Al momento questa cerchia non ha una chat di gruppo."
#: snikket_web/templates/admin_edit_circle.html:64 #: snikket_web/templates/admin_edit_circle.html:64
msgid "Add group chat" msgid "Add group chat"