added debugprints

This commit is contained in:
Justus Ojala
2025-09-22 18:22:08 +03:00
parent 05e6ba01d9
commit 162759dcb2
+3
View File
@@ -207,13 +207,16 @@ class SignupViewSet(ModelViewSet):
def key_is_unique(self, submitKey):
current_time = time.time()
printf("Checking", key)
# Remove expired keys from dict (older than 1 h)
# A key that expires as the function is called is considered valid
printf("Keys", submit_keys)
SignupViewSet.submit_keys = {
key: time
for key, time in SignupViewSet.submit_keys.items()
if time + 3600 >= current_time
}
printf("After", submit_keys)
if submitKey not in SignupViewSet.submit_keys: # Key is unique; valid
SignupViewSet.submit_keys[submitKey] = current_time
return True