added debugprints
This commit is contained in:
@@ -207,13 +207,16 @@ class SignupViewSet(ModelViewSet):
|
|||||||
|
|
||||||
def key_is_unique(self, submitKey):
|
def key_is_unique(self, submitKey):
|
||||||
current_time = time.time()
|
current_time = time.time()
|
||||||
|
printf("Checking", key)
|
||||||
# Remove expired keys from dict (older than 1 h)
|
# Remove expired keys from dict (older than 1 h)
|
||||||
# A key that expires as the function is called is considered valid
|
# A key that expires as the function is called is considered valid
|
||||||
|
printf("Keys", submit_keys)
|
||||||
SignupViewSet.submit_keys = {
|
SignupViewSet.submit_keys = {
|
||||||
key: time
|
key: time
|
||||||
for key, time in SignupViewSet.submit_keys.items()
|
for key, time in SignupViewSet.submit_keys.items()
|
||||||
if time + 3600 >= current_time
|
if time + 3600 >= current_time
|
||||||
}
|
}
|
||||||
|
printf("After", submit_keys)
|
||||||
if submitKey not in SignupViewSet.submit_keys: # Key is unique; valid
|
if submitKey not in SignupViewSet.submit_keys: # Key is unique; valid
|
||||||
SignupViewSet.submit_keys[submitKey] = current_time
|
SignupViewSet.submit_keys[submitKey] = current_time
|
||||||
return True
|
return True
|
||||||
|
|||||||
Reference in New Issue
Block a user