You've already forked snikket-web-portal
Compare commits
3 Commits
v0.1.0
...
feature/sl
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
725dffc458 | ||
|
|
22783b837e | ||
|
|
ba18fe692f |
36
Dockerfile
36
Dockerfile
@@ -3,44 +3,28 @@ FROM debian:buster
|
|||||||
ARG BUILD_SERIES=dev
|
ARG BUILD_SERIES=dev
|
||||||
ARG BUILD_ID=0
|
ARG BUILD_ID=0
|
||||||
|
|
||||||
ENV DEBIAN_FRONTEND noninteractive
|
COPY requirements.txt /opt/snikket-web-portal/requirements.txt
|
||||||
|
COPY build-requirements.txt /opt/snikket-web-portal/build-requirements.txt
|
||||||
|
COPY Makefile /opt/snikket-web-portal/Makefile
|
||||||
|
COPY snikket_web/ /opt/snikket-web-portal/snikket_web
|
||||||
|
COPY babel.cfg /opt/snikket-web-portal/babel.cfg
|
||||||
|
|
||||||
# This Dockerfile attempts to strike a balance between image size and time it
|
WORKDIR /opt/snikket-web-portal
|
||||||
# takes to do an incremental build on changes.
|
|
||||||
# Improvements welcome.
|
|
||||||
|
|
||||||
RUN set -eu; \
|
RUN set -eu; \
|
||||||
|
export DEBIAN_FRONTEND=noninteractive ; \
|
||||||
apt-get update ; \
|
apt-get update ; \
|
||||||
apt-get install -y --no-install-recommends \
|
apt-get install -y --no-install-recommends \
|
||||||
python3 python3-pip python3-setuptools python3-wheel \
|
python3 python3-pip python3-setuptools python3-wheel \
|
||||||
libpython3-dev \
|
libpython3-dev \
|
||||||
make build-essential \
|
make build-essential \
|
||||||
; \
|
; \
|
||||||
apt-get clean ; rm -rf /var/lib/apt/lists
|
|
||||||
|
|
||||||
COPY requirements.txt /opt/snikket-web-portal/requirements.txt
|
|
||||||
COPY build-requirements.txt /opt/snikket-web-portal/build-requirements.txt
|
|
||||||
|
|
||||||
WORKDIR /opt/snikket-web-portal
|
|
||||||
|
|
||||||
RUN set -eu; \
|
|
||||||
pip3 install -r requirements.txt; \
|
pip3 install -r requirements.txt; \
|
||||||
pip3 install -r build-requirements.txt; \
|
pip3 install -r build-requirements.txt; \
|
||||||
rm -rf /root/.cache;
|
|
||||||
|
|
||||||
COPY Makefile /opt/snikket-web-portal/Makefile
|
|
||||||
COPY snikket_web/ /opt/snikket-web-portal/snikket_web
|
|
||||||
COPY babel.cfg /opt/snikket-web-portal/babel.cfg
|
|
||||||
|
|
||||||
# NOTE: abusing true(1) as a terrible way to disable a specific command. If
|
|
||||||
# one merged all the RUN commands into one, one would want to run the
|
|
||||||
# uninstall/remove commands there, but with the split up RUN commands it is
|
|
||||||
# rather pointless.
|
|
||||||
RUN set -eu; \
|
|
||||||
make; \
|
make; \
|
||||||
true pip3 uninstall -yr build-requirements.txt; \
|
pip3 uninstall -yr build-requirements.txt; \
|
||||||
true apt-get remove -y build-essential make libpython3-dev; \
|
apt-get remove -y build-essential make libpython3-dev; \
|
||||||
true apt-get autoremove -y; \
|
apt-get autoremove -y; \
|
||||||
pip3 install hypercorn; \
|
pip3 install hypercorn; \
|
||||||
rm -rf /root/.cache; \
|
rm -rf /root/.cache; \
|
||||||
apt-get clean ; rm -rf /var/lib/apt/lists
|
apt-get clean ; rm -rf /var/lib/apt/lists
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 82 KiB After Width: | Height: | Size: 421 KiB |
@@ -1,4 +1,3 @@
|
|||||||
import asyncio
|
|
||||||
import json
|
import json
|
||||||
import typing
|
import typing
|
||||||
|
|
||||||
@@ -362,25 +361,21 @@ async def edit_circle(id_: str) -> typing.Union[str, quart.Response]:
|
|||||||
return redirect(url_for(".circles"))
|
return redirect(url_for(".circles"))
|
||||||
raise
|
raise
|
||||||
|
|
||||||
circle_members = await asyncio.gather(*(
|
users = sorted(
|
||||||
client.get_user_by_localpart(
|
await client.list_users(),
|
||||||
localpart,
|
key=lambda x: x.localpart
|
||||||
session=session,
|
)
|
||||||
)
|
circle_members = [
|
||||||
for localpart in sorted(circle.members)
|
user for user in users
|
||||||
))
|
if user.localpart in circle.members
|
||||||
|
]
|
||||||
users = await client.list_users()
|
|
||||||
|
|
||||||
form = EditCircleForm()
|
form = EditCircleForm()
|
||||||
form.user_to_add.choices = sorted(
|
form.user_to_add.choices = [
|
||||||
(
|
(user.localpart, user.localpart)
|
||||||
(u.localpart, u.localpart)
|
for user in users
|
||||||
for u in users
|
if user.localpart not in circle.members
|
||||||
if u.localpart not in circle.members
|
]
|
||||||
),
|
|
||||||
key=lambda x: x[1]
|
|
||||||
)
|
|
||||||
valid_users = [x[0] for x in form.user_to_add.choices]
|
valid_users = [x[0] for x in form.user_to_add.choices]
|
||||||
|
|
||||||
invite_form = InvitePost()
|
invite_form = InvitePost()
|
||||||
|
|||||||
Reference in New Issue
Block a user