kopia lustrzana https://dev.funkwhale.audio/funkwhale/funkwhale
10 wiersze
329 B
Python
10 wiersze
329 B
Python
|
class RecordActivityMiddleware:
|
||
|
def __init__(self, get_response):
|
||
|
self.get_response = get_response
|
||
|
|
||
|
def __call__(self, request):
|
||
|
response = self.get_response(request)
|
||
|
if hasattr(request, "user") and request.user.is_authenticated:
|
||
|
request.user.record_activity()
|
||
|
return response
|