Compare commits

...

2 Commits

Author SHA1 Message Date
83a02d69d4 fix: get invited by correctly
All checks were successful
continuous-integration/drone/push Build is passing
2022-01-10 17:43:00 +01:00
a97a19d134 fix; missing env vars 2022-01-10 17:20:51 +01:00
3 changed files with 9 additions and 4 deletions

View File

@ -10,7 +10,7 @@ KEYCLOAK_DOMAIN=login.lumbung.space
KEYCLOAK_REALM=lumbung-space
LETS_ENCRYPT_ENV=production
NEXTCLOUD_API_BASE_URL=cloud.lumbung.space
NEXTCLOUD_APP_PASSWORD=fizzbang
NEXTCLOUD_APP_SECRET=fizzbang
NEXTCLOUD_USER=decentral1se
REDIS_DB=0
REDIS_HOST=localhost

View File

@ -13,7 +13,9 @@ services:
- KEYCLOAK_CLIENT_SECRET_FILE=/run/secrets/keycloak_client_secret
- KEYCLOAK_DOMAIN
- KEYCLOAK_REALM
- NEXTCLOUD_API_BASE_URL
- NEXTCLOUD_APP_SECRET_FILE=/run/secrets/nextcloud_app_secret
- NEXTCLOUD_USER
- REDIS_DB=0
- REDIS_HOST=cache
- REDIS_PORT=6379

View File

@ -18,13 +18,16 @@ async def register_invite(
):
from members_lumbung_space.config import INVITE_TIME_LIMIT
matching, username, matching_invite = False, None, None
matching, invited_by, matching_invite = False, None, None
for username in invites:
for _invite in invites[username]:
if invite == _invite["link"]:
matching = True
username = username
invited_by = username
matching_invite = _invite
break
if matching:
break
if not matching:
message = "This invite does not exist, sorry."
@ -45,7 +48,7 @@ async def register_invite(
"invalid.html", context=context
)
context = {"request": request, "invited_by": username}
context = {"request": request, "invited_by": invited_by}
return request.app.state.templates.TemplateResponse(
"register.html", context=context
)