fix: get invited by correctly
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
cellarspoon
2022-01-10 17:43:00 +01:00
parent a97a19d134
commit 83a02d69d4
2 changed files with 7 additions and 4 deletions

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
)