mirror of
https://github.com/ae-utbm/sith.git
synced 2024-11-26 11:04:20 +00:00
Fixed lookup for loged barmen
This commit is contained in:
parent
17b483bd21
commit
17b098ca2a
@ -7,9 +7,14 @@ from club.models import Club
|
|||||||
from counter.models import Product, Counter
|
from counter.models import Product, Counter
|
||||||
from accounting.models import ClubAccount, Company
|
from accounting.models import ClubAccount, Company
|
||||||
|
|
||||||
|
def is_token(request):
|
||||||
|
return ('counter_token' in request.session.keys() and
|
||||||
|
request.session['counter_token'] and
|
||||||
|
Counter.objects.filter(token=request.session['counter_token']).exists())
|
||||||
|
|
||||||
class RightManagedLookupChannel(LookupChannel):
|
class RightManagedLookupChannel(LookupChannel):
|
||||||
def check_auth(self, request):
|
def check_auth(self, request):
|
||||||
if not request.user.subscribed:
|
if not request.user.subscribed and not is_token(request):
|
||||||
raise PermissionDenied
|
raise PermissionDenied
|
||||||
|
|
||||||
@register('users')
|
@register('users')
|
||||||
|
Loading…
Reference in New Issue
Block a user