mirror of
https://gitlab.crans.org/bde/nk20
synced 2025-06-21 01:48:21 +02:00
Add backdoor to login as other users (in debug mode only)
This commit is contained in:
@ -4,6 +4,7 @@
|
||||
from functools import lru_cache
|
||||
from time import time
|
||||
|
||||
from django.conf import settings
|
||||
from django.contrib.sessions.models import Session
|
||||
from note_kfet.middlewares import get_current_session
|
||||
|
||||
@ -32,6 +33,10 @@ def memoize(f):
|
||||
sess_funs = new_sess_funs
|
||||
|
||||
def func(*args, **kwargs):
|
||||
if settings.DEBUG:
|
||||
# Don't memoize in DEBUG mode
|
||||
return f(*args, **kwargs)
|
||||
|
||||
nonlocal last_collect
|
||||
|
||||
if time() - last_collect > 60:
|
||||
|
Reference in New Issue
Block a user