Compare commits

...

26 Commits

Author SHA1 Message Date
Jonas Schäfer
51f2ebbd13 Handle the correct exception when formatting extremely high amounts of bytes
Found in production. Yes really. Due to some borked LXC integration, my
snikket host reports

```
MemTotal:       9007199254740991 kB
MemFree:        9007199254690591 kB
MemAvailable:   9007199254690591 kB
```

That is more than 1024 TiB, so it tries to go further up in the scale,
which then causes a Guru Meditation because of the uncaught IndexError.
2022-01-10 17:32:11 +01:00
Jonas Schäfer
b4e6ee8943 Fix formatting of zero bytes
Previously, that would raise a ValueError (math domain error), because
log(0) is undefined.
2022-01-10 17:31:50 +01:00
Jonas Schäfer
aed9ad1cde Merge pull request #93 from Zash/debianbullseye
Dockerfile: Switch base image to Debian 11
2022-01-10 16:40:28 +01:00
Kim Alvefur
b545c137b1 Dockerfile: Switch base image to Debian 11 2022-01-10 16:27:38 +01:00
Matthew Wild
47642dc384 Merge pull request #108 from snikket-im/feature/multi-stage-dockerfile
Dockerfile: Split build into multiple stages
2022-01-10 14:21:57 +00:00
Jonas Schäfer
5d7183a0b8 Reinstate cache deletion in multi-stage build
Previously, the multi-stage build increased the image size by about 30
MiB (163MiB -> 191MiB). Dropping the caches reduces the image size down
to 159MiB, leading to a net improvement of 4 MiB.
2022-01-08 13:29:28 +01:00
Matthew Wild
c1cf6ab1e5 Dockerfile: Split build into multiple stages
Currently the Dockerfile has a single RUN directive with all the needed
commands in it. This optimizes for image size by not creating too many
"layers" (which are only additive). However it means the result that gets
cached can basically never be reused, because any change to the source code
will need to execute the whole RUN block again.

This commit switches to a docker "multi-stage" build, where we have a build
image that is separate from the final one that gets published. The build
image can be cached locally, and size is no longer a significant concern.

This approach allows the single RUN command to be split up into multiple RUN
commands that only execute when strictly needed (i.e. when their result
is not cached locally).

This drastically improves the build time when rebuilding the image after
a simple code change, because the build image doesn't have to install all
the apt packages, for example. This leads to a nicer developer experience
when using docker locally for development and testing.
2022-01-08 13:17:52 +01:00
Jonas Schäfer
aee53a2e1a Merge pull request #109 from snikket-im/feature/fix-mypy
Fix mypy false positives
2022-01-08 13:14:28 +01:00
Jonas Schäfer
3a81a0140b Revert "Fix spurious mypy error"
This reverts commit 28ff19c19c.
2022-01-08 13:12:30 +01:00
Jonas Schäfer
5b4d4ddd36 Fix some mypy regression 2022-01-08 13:12:30 +01:00
Jonas Schäfer
28ff19c19c Fix spurious mypy error
For whatever reason, it thinks that babel has no __version__ field, but
it in fact does.
2022-01-08 12:52:31 +01:00
uira
8e3837f704 Translated using Weblate (Indonesian)
Currently translated at 100.0% (303 of 303 strings)

Translation: Snikket/Web Portal
Translate-URL: http://i18n.sotecware.net/projects/snikket/web-portal/id/
2021-12-12 07:00:42 +00:00
Matthew Wild
98e7de3166 Merge pull request #104 from snikket-im/feature/enable-restricted-users
admin: Show restricted user role in the UI
2021-11-09 17:03:08 +00:00
Matthew Wild
61c71b2145 admin: Inline restricted user role name
It was a variable only for the benefit of translators while disabled.
2021-11-09 17:00:59 +00:00
Matthew Wild
6b35e9a259 admin: Show restricted user role in the UI 2021-11-09 16:40:50 +00:00
Matthew Wild
58c2112fec Merge pull request #102 from snikket-im/feature/pin-wtforms
Pin wtforms to 2.x
2021-11-09 10:48:18 +00:00
Jonas Schäfer
c856afee82 Pin wtforms to 2.x
wtforms 3.0 is incompatible with our code. A separate issue will be
filed to address the incompatibilities, but this should be enough to get
working images out of it.

With 3.x, we're seeing:

```
  File "/home/horazont/Projects/python/snikket-web-portal/snikket_web/main.py", line 35, in LoginForm
    address = wtforms.TextField(
AttributeError: module 'wtforms' has no attribute 'TextField'
```

and the portal fails to start.
2021-11-08 18:07:34 +01:00
Matthew Wild
c8356a8e9e Merge pull request #101 from snikket-im/feature/https-qr
Force invite QR code to HTTPS
2021-10-15 14:32:57 +01:00
Jonas Schäfer
0eb464f428 Force invite QR code to HTTPS
We could also do a thing with ProxyFix, but honestly, this should always
be HTTPS.
2021-10-15 15:21:22 +02:00
misiek
2a6ef3c8f1 Translated using Weblate (Polish)
Currently translated at 100.0% (303 of 303 strings)

Translation: Snikket/Web Portal
Translate-URL: http://i18n.sotecware.net/projects/snikket/web-portal/pl/
2021-09-03 15:00:35 +00:00
Matthew Wild
b5d148458a Merge pull request #98 from snikket-im/feature/apple
🎉 Finally set the URL for the App Store
2021-09-02 14:42:02 +01:00
Jonas Schäfer
ff99c9488a Merge pull request #96 from Zash/invite_success_link
Link to main page after successful registration
2021-08-30 15:47:41 +02:00
Kim Alvefur
fe78631039 Link to main page after successful registration
Someone who registers via the web might also be interested in the web
portal.

Thanks to Jonas and Matthew for feedback on draft commit and help with
whatever this template syntax is.

Also no thanks to git for not actually having draft commits as a concept.
Mercurial is so much nicer to work with.
2021-08-29 15:10:02 +02:00
Kim Alvefur
12ddd288bf Translated using Weblate (Swedish)
Currently translated at 100.0% (303 of 303 strings)

Translation: Snikket/Web Portal
Translate-URL: http://i18n.sotecware.net/projects/snikket/web-portal/sv/
2021-08-01 14:00:44 +00:00
misiek
633fb0d084 Translated using Weblate (Polish)
Currently translated at 97.0% (294 of 303 strings)

Translation: Snikket/Web Portal
Translate-URL: http://i18n.sotecware.net/projects/snikket/web-portal/pl/
2021-08-01 14:00:44 +00:00
uira
f9690063bc Translated using Weblate (Indonesian)
Currently translated at 100.0% (303 of 303 strings)

Translation: Snikket/Web Portal
Translate-URL: https://i18n.sotecware.net/projects/snikket/web-portal/id/
2021-06-21 23:01:04 +00:00
13 changed files with 117 additions and 97 deletions

View File

@@ -1,7 +1,13 @@
FROM debian:buster-slim
FROM debian:bullseye-slim AS build
ARG BUILD_SERIES=dev
ARG BUILD_ID=0
RUN set -eu; \
export DEBIAN_FRONTEND=noninteractive ; \
apt-get update ; \
apt-get install -y --no-install-recommends \
python3 python3-pip python3-setuptools python3-wheel \
libpython3-dev \
make build-essential \
netcat;
COPY requirements.txt /opt/snikket-web-portal/requirements.txt
COPY build-requirements.txt /opt/snikket-web-portal/build-requirements.txt
@@ -11,32 +17,41 @@ COPY babel.cfg /opt/snikket-web-portal/babel.cfg
WORKDIR /opt/snikket-web-portal
RUN set -eu; \
export DEBIAN_FRONTEND=noninteractive ; \
apt-get update ; \
apt-get install -y --no-install-recommends \
python3 python3-pip python3-setuptools python3-wheel \
libpython3-dev \
make build-essential \
netcat \
; \
pip3 install -r requirements.txt; \
RUN pip3 install -r requirements.txt; \
pip3 install -r build-requirements.txt; \
make; \
pip3 uninstall -yr build-requirements.txt; \
apt-get remove -y build-essential make libpython3-dev; \
apt-get autoremove -y; \
pip3 install hypercorn; \
rm -rf /root/.cache; \
apt-get clean ; rm -rf /var/lib/apt/lists
make;
FROM debian:bullseye-slim
ARG BUILD_SERIES=dev
ARG BUILD_ID=0
COPY docker/env.py /etc/snikket-web-portal/env.py
ENV SNIKKET_WEB_PYENV=/etc/snikket-web-portal/env.py
ENV SNIKKET_WEB_PROSODY_ENDPOINT=http://127.0.0.1:5280/
HEALTHCHECK CMD nc -zv ${SNIKKET_TWEAK_PORTAL_INTERNAL_HTTP_INTERFACE:-127.0.0.1} ${SNIKKET_TWEAK_PORTAL_INTERNAL_HTTP_PORT:-5765}
RUN set -eu; \
export DEBIAN_FRONTEND=noninteractive ; \
apt-get update ; \
apt-get install -y --no-install-recommends \
python3 python3-pip python3-setuptools python3-wheel; \
apt-get clean ; rm -rf /var/lib/apt/lists; \
pip3 install hypercorn; \
rm -rf /root/.cache;
WORKDIR /opt/snikket-web-portal
COPY requirements.txt /opt/snikket-web-portal/requirements.txt
RUN pip3 install -r requirements.txt; rm -rf /root/.cache;
COPY --from=build /opt/snikket-web-portal/snikket_web/ /opt/snikket-web-portal/snikket_web
COPY babel.cfg /opt/snikket-web-portal/babel.cfg
RUN echo "$BUILD_SERIES $BUILD_ID" > /opt/snikket-web-portal/.app_version
ADD docker/entrypoint.sh /entrypoint.sh

View File

@@ -5,4 +5,5 @@ hsluv~=0.0.2
flask-babel~=1.0
email-validator~=1.1
environ-config~=20.0
wtforms~=2.3
typing-extensions

View File

@@ -63,9 +63,6 @@ async def users() -> str:
)
_LIMITED_ROLE_NAME = _("Limited")
class EditUserForm(BaseForm):
localpart = wtforms.StringField(
_l("Login name"),
@@ -78,9 +75,7 @@ class EditUserForm(BaseForm):
role = wtforms.RadioField(
_l("Access Level"),
choices=[
# NOTE: enable this only after something has been done which
# actually enforces the described restrictions :).
# ("prosody:restricted", _LIMITED_ROLE_NAME),
("prosody:restricted", _("Limited")),
("prosody:normal", _l("Normal user")),
("prosody:admin", _l("Administrator")),
],

View File

@@ -53,11 +53,14 @@ def circle_name(c: typing.Any) -> str:
def format_bytes(n: float) -> str:
scale = math.floor(math.log(n, 1024))
try:
scale = max(math.floor(math.log(n, 1024)), 0)
except ValueError:
scale = 0
try:
unit = BYTE_UNIT_SCALE_MAP[scale]
factor = 1024**scale
except ValueError:
except IndexError:
unit = "TiB"
factor = 1024**4
if factor > 1:

View File

@@ -15,6 +15,6 @@
{% trans %}Copy address{% endtrans %}
{%- endcall -%}
<p>{% trans %}You can now set up your legacy XMPP client with the above address and the password you chose during registration.{% endtrans %}</p>
<p>{% trans %}You can now safely close this page.{% endtrans %}</p>
<p>{% trans login_url=url_for('main.login') %}You can now safely close this page, or log in to the web portal to <a href="{{ login_url }}">manage your account</a>.{% endtrans %}</p>
</div>
{% endblock %}

View File

@@ -68,7 +68,7 @@
{#- -#}
<div id="qr-info-url" class="tab-pane active">
<p>{% trans %}Use a <em>QR code</em> scanner on your mobile device to scan the code below:{% endtrans %}</p>
<div id="qr-invite-page" data-qrdata="{{ url_for(".view", id_=invite_id, _external=True) }}" class="qr"></div>
<div id="qr-invite-page" data-qrdata="{{ url_for(".view", id_=invite_id, _external=True, _scheme="https") }}" class="qr"></div>
</div>
{#- -#}
<div id="qr-info-uri" class="tab-pane">

View File

@@ -6,18 +6,18 @@
msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"Report-Msgid-Bugs-To: translations@snikket.org\n"
"POT-Creation-Date: 2021-06-18 16:05+0200\n"
"PO-Revision-Date: 2021-05-19 15:12+0000\n"
"PO-Revision-Date: 2021-12-12 07:00+0000\n"
"Last-Translator: uira <inboxriau@andriana.id>\n"
"Language-Team: Indonesian <https://i18n.sotecware.net/projects/snikket/web-"
"portal/id/>\n"
"Language-Team: Indonesian <http://i18n.sotecware.net/projects/snikket/"
"web-portal/id/>\n"
"Language: id\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"X-Generator: Weblate 4.5.1\n"
"X-Generator: Weblate 4.8.1\n"
"Generated-By: Babel 2.9.0\n"
#: snikket_web/admin.py:66
@@ -194,23 +194,23 @@ msgstr "Pengguna dihapus dari kelompok"
#: snikket_web/admin.py:616
msgid "Message contents"
msgstr ""
msgstr "Isi pesan"
#: snikket_web/admin.py:622
msgid "Only send to online users"
msgstr ""
msgstr "Hanya kirim ke pengguna online"
#: snikket_web/admin.py:626
msgid "Post to all users"
msgstr ""
msgstr "Kirim ke semua pengguna"
#: snikket_web/admin.py:630
msgid "Send preview to yourself"
msgstr ""
msgstr "Kirim pratinjau ke diri sendiri"
#: snikket_web/admin.py:652
msgid "Announcement sent!"
msgstr ""
msgstr "Pengumuman terkirim!"
#: snikket_web/infra.py:51
msgid "Main"
@@ -630,7 +630,7 @@ msgstr "Anggota kelompok"
#: snikket_web/templates/admin_edit_circle.html:71
msgid "The user has been deleted from the server."
msgstr ""
msgstr "Pengguna telah dihapus dari server"
#: snikket_web/templates/admin_edit_circle.html:71
#: snikket_web/templates/library.j2:108
@@ -843,22 +843,20 @@ msgstr "Kelola undangan"
#: snikket_web/templates/admin_home.html:35
msgid "System health"
msgstr ""
msgstr "Kesehatan sistem"
#: snikket_web/templates/admin_home.html:38
msgid "View the server status or send a broadcast message to all users."
msgstr ""
msgstr "Lihat status server atau kirim pesan siaran ke semua pengguna."
#: snikket_web/templates/admin_home.html:40
msgid "Send a broadcast message to all users."
msgstr ""
msgstr "Kirim pesan siaran ke semua pengguna."
#: snikket_web/templates/admin_home.html:43
#: snikket_web/templates/admin_system.html:4
#, fuzzy
#| msgid "Manage users"
msgid "Manage system"
msgstr "Kelola pengguna"
msgstr "Kelola sistem"
#: snikket_web/templates/admin_home.html:48
msgid "Go back to your user's web portal page."
@@ -919,11 +917,11 @@ msgstr "Hancurkan tautan"
#: snikket_web/templates/admin_system.html:6
msgid "Overall system status"
msgstr ""
msgstr "Kesehatan sistem keseluruhan"
#: snikket_web/templates/admin_system.html:9
msgid "System load (5 minute average)"
msgstr ""
msgstr "Beban sistem (rata-rata 5 menit)"
#: snikket_web/templates/admin_system.html:14
#: snikket_web/templates/admin_system.html:22
@@ -933,11 +931,11 @@ msgstr ""
#: snikket_web/templates/admin_system.html:68
#: snikket_web/templates/admin_system.html:76
msgid "unknown"
msgstr ""
msgstr "Tidak diketahui"
#: snikket_web/templates/admin_system.html:17
msgid "Memory use"
msgstr ""
msgstr "Penggunaan memori"
#: snikket_web/templates/admin_system.html:20
#, python-format
@@ -945,50 +943,52 @@ msgid ""
"%(percentage_global)s of %(mem_available)s. Of that, Snikket uses "
"%(percentage_snikket)s."
msgstr ""
"%(percentage_global)s of %(mem_available)s. Dari jumlah itu, Snikket "
"menggunakan %(percentage_snikket)s."
#: snikket_web/templates/admin_system.html:27
msgid "Web portal status"
msgstr ""
msgstr "Status portal web"
#: snikket_web/templates/admin_system.html:30
#: snikket_web/templates/admin_system.html:53
msgid "Version"
msgstr ""
msgstr "Versi"
#: snikket_web/templates/admin_system.html:31
#: snikket_web/templates/admin_system.html:54
msgid "View all versions"
msgstr ""
msgstr "Lihat versi semua"
#: snikket_web/templates/admin_system.html:32
#: snikket_web/templates/admin_system.html:55
msgid "Average CPU use"
msgstr ""
msgstr "Penggunaan CPU rata-rata"
#: snikket_web/templates/admin_system.html:40
#: snikket_web/templates/admin_system.html:63
msgid "Current memory use"
msgstr ""
msgstr "Penggunaan CPU rata-rata"
#: snikket_web/templates/admin_system.html:50
#, fuzzy
#| msgid "Snikket Web Portal"
msgid "Snikket server status"
msgstr "Portal Web Snikket"
msgstr "Status server Snikket"
#: snikket_web/templates/admin_system.html:71
msgid "Connected devices"
msgstr ""
msgstr "Perangkat terhubung"
#: snikket_web/templates/admin_system.html:82
msgid "Broadcast message"
msgstr ""
msgstr "Sebarkan pesan"
#: snikket_web/templates/admin_system.html:84
msgid ""
"This form allows you to send a message to all users currently online on your "
"Snikket server. Use it wisely."
msgstr ""
"Form ini memungkinkan mengirim pesan ke semua pengguna yang saat ini online "
"di server Snikket Anda. Gunakan dengan bijak."
#: snikket_web/templates/admin_users.html:19
msgid "The user is an administrator."

View File

@@ -8,17 +8,17 @@ msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2021-06-18 16:05+0200\n"
"PO-Revision-Date: 2021-05-19 15:12+0000\n"
"PO-Revision-Date: 2021-09-03 15:00+0000\n"
"Last-Translator: misiek <migelazur@mailbox.org>\n"
"Language-Team: Polish <https://i18n.sotecware.net/projects/snikket/web-"
"portal/pl/>\n"
"Language-Team: Polish <http://i18n.sotecware.net/projects/snikket/web-portal/"
"pl/>\n"
"Language: pl\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 "
"|| n%100>=20) ? 1 : 2;\n"
"X-Generator: Weblate 4.5.1\n"
"X-Generator: Weblate 4.7.2\n"
"Generated-By: Babel 2.9.0\n"
#: snikket_web/admin.py:66
@@ -195,23 +195,23 @@ msgstr "Usunięto użytkownika z kręgu"
#: snikket_web/admin.py:616
msgid "Message contents"
msgstr ""
msgstr "Treść wiadomości"
#: snikket_web/admin.py:622
msgid "Only send to online users"
msgstr ""
msgstr "Wyślij jedynie do użytkowników online"
#: snikket_web/admin.py:626
msgid "Post to all users"
msgstr ""
msgstr "Wyślij do wszystkich użytkowników"
#: snikket_web/admin.py:630
msgid "Send preview to yourself"
msgstr ""
msgstr "Prześlij do siebie podgląd wiadomości"
#: snikket_web/admin.py:652
msgid "Announcement sent!"
msgstr ""
msgstr "Komunikat wysłany!"
#: snikket_web/infra.py:51
msgid "Main"
@@ -629,7 +629,7 @@ msgstr "Członkowie kręgu"
#: snikket_web/templates/admin_edit_circle.html:71
msgid "The user has been deleted from the server."
msgstr ""
msgstr "Użytkownik został usunięty z serwera."
#: snikket_web/templates/admin_edit_circle.html:71
#: snikket_web/templates/library.j2:108
@@ -844,22 +844,21 @@ msgstr "Zarządzaj zaproszeniami"
#: snikket_web/templates/admin_home.html:35
msgid "System health"
msgstr ""
msgstr "Stan systemu"
#: snikket_web/templates/admin_home.html:38
msgid "View the server status or send a broadcast message to all users."
msgstr ""
"Podejrzyj status serwera lub prześlij komunikat do wszystkich użytkowników."
#: snikket_web/templates/admin_home.html:40
msgid "Send a broadcast message to all users."
msgstr ""
msgstr "Prześlij komunikat do wszystkich użytkowników."
#: snikket_web/templates/admin_home.html:43
#: snikket_web/templates/admin_system.html:4
#, fuzzy
#| msgid "Manage users"
msgid "Manage system"
msgstr "Zarządzaj użytkownikami"
msgstr "Zarządzaj systemem"
#: snikket_web/templates/admin_home.html:48
msgid "Go back to your user's web portal page."
@@ -920,11 +919,11 @@ msgstr "Zniszcz link"
#: snikket_web/templates/admin_system.html:6
msgid "Overall system status"
msgstr ""
msgstr "Ogólny status systemu"
#: snikket_web/templates/admin_system.html:9
msgid "System load (5 minute average)"
msgstr ""
msgstr "Obciążenie systemu (dla ostatnich 5 minut)"
#: snikket_web/templates/admin_system.html:14
#: snikket_web/templates/admin_system.html:22
@@ -934,11 +933,11 @@ msgstr ""
#: snikket_web/templates/admin_system.html:68
#: snikket_web/templates/admin_system.html:76
msgid "unknown"
msgstr ""
msgstr "nieznane"
#: snikket_web/templates/admin_system.html:17
msgid "Memory use"
msgstr ""
msgstr "Wykorzystanie pamięci"
#: snikket_web/templates/admin_system.html:20
#, python-format
@@ -946,50 +945,52 @@ msgid ""
"%(percentage_global)s of %(mem_available)s. Of that, Snikket uses "
"%(percentage_snikket)s."
msgstr ""
"%(percentage_global)s z %(mem_available)s. Z tego Snikket używa "
"%(percentage_snikket)s."
#: snikket_web/templates/admin_system.html:27
msgid "Web portal status"
msgstr ""
msgstr "Status portalu internetowego"
#: snikket_web/templates/admin_system.html:30
#: snikket_web/templates/admin_system.html:53
msgid "Version"
msgstr ""
msgstr "Wersja"
#: snikket_web/templates/admin_system.html:31
#: snikket_web/templates/admin_system.html:54
msgid "View all versions"
msgstr ""
msgstr "Pokaż wszystkie wersje"
#: snikket_web/templates/admin_system.html:32
#: snikket_web/templates/admin_system.html:55
msgid "Average CPU use"
msgstr ""
msgstr "Średnie użycie CPU"
#: snikket_web/templates/admin_system.html:40
#: snikket_web/templates/admin_system.html:63
msgid "Current memory use"
msgstr ""
msgstr "Bieżące użycie pamięci"
#: snikket_web/templates/admin_system.html:50
#, fuzzy
#| msgid "Snikket Web Portal"
msgid "Snikket server status"
msgstr "Portal użytkownika Snikket"
msgstr "Status serwera Snikket"
#: snikket_web/templates/admin_system.html:71
msgid "Connected devices"
msgstr ""
msgstr "Podłączone urządzenia"
#: snikket_web/templates/admin_system.html:82
msgid "Broadcast message"
msgstr ""
msgstr "Wiadomość globalna"
#: snikket_web/templates/admin_system.html:84
msgid ""
"This form allows you to send a message to all users currently online on your "
"Snikket server. Use it wisely."
msgstr ""
"Ten formularz pozwala na wysłanie wiadomości do wszystkich użytkowników, "
"którzy obecnie są online na twoim serwerze Snikket. Używaj go z rozwagą."
#: snikket_web/templates/admin_users.html:19
msgid "The user is an administrator."

View File

@@ -8,16 +8,16 @@ msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2021-06-18 16:05+0200\n"
"PO-Revision-Date: 2021-05-28 21:00+0000\n"
"PO-Revision-Date: 2021-08-01 14:00+0000\n"
"Last-Translator: Kim Alvefur <zash@zash.se>\n"
"Language-Team: Swedish <https://i18n.sotecware.net/projects/snikket/web-"
"portal/sv/>\n"
"Language-Team: Swedish <http://i18n.sotecware.net/projects/snikket/"
"web-portal/sv/>\n"
"Language: sv\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.5.1\n"
"X-Generator: Weblate 4.7.2\n"
"Generated-By: Babel 2.9.0\n"
#: snikket_web/admin.py:66
@@ -624,7 +624,7 @@ msgstr "Medlemmar i krets"
#: snikket_web/templates/admin_edit_circle.html:71
msgid "The user has been deleted from the server."
msgstr ""
msgstr "Användaren har raderats från servern."
#: snikket_web/templates/admin_edit_circle.html:71
#: snikket_web/templates/library.j2:108

View File

@@ -207,7 +207,7 @@ def make_avatar_metadata_set_request(
item,
"metadata", xmlns=NS_USER_AVATAR_METADATA)
attr: typing.MutableMapping[str, str] = {
attr: typing.Dict[str, str] = {
"id": id_,
"bytes": str(size),
"type": mimetype,
@@ -217,7 +217,12 @@ def make_avatar_metadata_set_request(
if height is not None:
attr["height"] = str(height)
ET.SubElement(metadata_wrap, "info", xmlns=NS_USER_AVATAR_METADATA, **attr)
ET.SubElement(
metadata_wrap,
"info",
xmlns=NS_USER_AVATAR_METADATA,
**attr, # type: ignore
)
return req