This commit is contained in:
@@ -25,10 +25,14 @@ def home(request):
|
||||
except Exception:
|
||||
perm = 1
|
||||
has_manage_key = bool((u or {}).get("manage_key") or [])
|
||||
can_manage_registration_codes = bool(int((u or {}).get("can_manage_registration_codes") or 0) == 1)
|
||||
has_registration_code = bool(str((u or {}).get("registration_code") or "").strip())
|
||||
context = {
|
||||
"user_id": uid,
|
||||
"username": (u or {}).get("username"),
|
||||
"is_admin": (int(perm) == 0),
|
||||
"has_manage_key": has_manage_key,
|
||||
"can_manage_registration_codes": can_manage_registration_codes,
|
||||
"has_registration_code": has_registration_code,
|
||||
}
|
||||
return render(request, "main/home.html", context)
|
||||
|
||||
Reference in New Issue
Block a user