Add backdoor to login as other users (in debug mode only)
This commit is contained in:
parent
b49db39080
commit
fb775de923
6 changed files with 53 additions and 7 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue