mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-09 19:40:19 +00:00
Some other performance improvements
This commit is contained in:
@ -18,6 +18,7 @@ import os
|
||||
|
||||
from core.models import SithFile, RealGroup, Notification
|
||||
from core.views import CanViewMixin, CanEditMixin, CanEditPropMixin, CanCreateMixin, can_view, not_found
|
||||
from counter.models import Counter
|
||||
|
||||
def send_file(request, file_id, file_class=SithFile, file_attr="file"):
|
||||
"""
|
||||
@ -28,7 +29,6 @@ def send_file(request, file_id, file_class=SithFile, file_attr="file"):
|
||||
f = file_class.objects.filter(id=file_id).first()
|
||||
if f is None or not f.file:
|
||||
return not_found(request)
|
||||
from counter.models import Counter
|
||||
if not (can_view(f, request.user) or
|
||||
('counter_token' in request.session.keys() and
|
||||
request.session['counter_token'] and # check if not null for counters that have no token set
|
||||
|
Reference in New Issue
Block a user