fix: get invited by correctly
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
a97a19d134
commit
83a02d69d4
@ -10,7 +10,7 @@ KEYCLOAK_DOMAIN=login.lumbung.space
|
|||||||
KEYCLOAK_REALM=lumbung-space
|
KEYCLOAK_REALM=lumbung-space
|
||||||
LETS_ENCRYPT_ENV=production
|
LETS_ENCRYPT_ENV=production
|
||||||
NEXTCLOUD_API_BASE_URL=cloud.lumbung.space
|
NEXTCLOUD_API_BASE_URL=cloud.lumbung.space
|
||||||
NEXTCLOUD_APP_PASSWORD=fizzbang
|
NEXTCLOUD_APP_SECRET=fizzbang
|
||||||
NEXTCLOUD_USER=decentral1se
|
NEXTCLOUD_USER=decentral1se
|
||||||
REDIS_DB=0
|
REDIS_DB=0
|
||||||
REDIS_HOST=localhost
|
REDIS_HOST=localhost
|
||||||
|
@ -18,13 +18,16 @@ async def register_invite(
|
|||||||
):
|
):
|
||||||
from members_lumbung_space.config import INVITE_TIME_LIMIT
|
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 username in invites:
|
||||||
for _invite in invites[username]:
|
for _invite in invites[username]:
|
||||||
if invite == _invite["link"]:
|
if invite == _invite["link"]:
|
||||||
matching = True
|
matching = True
|
||||||
username = username
|
invited_by = username
|
||||||
matching_invite = _invite
|
matching_invite = _invite
|
||||||
|
break
|
||||||
|
if matching:
|
||||||
|
break
|
||||||
|
|
||||||
if not matching:
|
if not matching:
|
||||||
message = "This invite does not exist, sorry."
|
message = "This invite does not exist, sorry."
|
||||||
@ -45,7 +48,7 @@ async def register_invite(
|
|||||||
"invalid.html", context=context
|
"invalid.html", context=context
|
||||||
)
|
)
|
||||||
|
|
||||||
context = {"request": request, "invited_by": username}
|
context = {"request": request, "invited_by": invited_by}
|
||||||
return request.app.state.templates.TemplateResponse(
|
return request.app.state.templates.TemplateResponse(
|
||||||
"register.html", context=context
|
"register.html", context=context
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user