Merge branch 'print-syntax' into 'main'

This isn't C

See merge request sahkoinsinoorikilta/vtmk/web2.0-backend!113
This commit is contained in:
Justus Ojala
2025-09-22 18:50:27 +03:00
+3 -3
View File
@@ -207,16 +207,16 @@ class SignupViewSet(ModelViewSet):
def key_is_unique(self, submitKey):
current_time = time.time()
printf("Checking", key)
print("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)
print("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)
print("After", submit_keys)
if submitKey not in SignupViewSet.submit_keys: # Key is unique; valid
SignupViewSet.submit_keys[submitKey] = current_time
return True