mirror of
https://github.com/nikdoof/test-auth.git
synced 2025-12-13 22:32:15 +00:00
Fixed some selects missed since the director roles selection changes
This commit is contained in:
@@ -39,7 +39,7 @@ def check_permissions(user, application=None):
|
|||||||
|
|
||||||
corplist = EVEPlayerCharacter.objects.filter(eveaccount__user=user,corporation__applications=True)
|
corplist = EVEPlayerCharacter.objects.filter(eveaccount__user=user,corporation__applications=True)
|
||||||
if not application:
|
if not application:
|
||||||
if user.has_perm('hr.can_view_all') or user.has_perm('hr.can_view_corp') or corplist.filter(director=True).count():
|
if user.has_perm('hr.can_view_all') or user.has_perm('hr.can_view_corp') or corplist.filter(roles__name='roleDirector').count():
|
||||||
return HR_ADMIN
|
return HR_ADMIN
|
||||||
else:
|
else:
|
||||||
if application.user == user:
|
if application.user == user:
|
||||||
@@ -48,7 +48,7 @@ def check_permissions(user, application=None):
|
|||||||
return HR_ADMIN
|
return HR_ADMIN
|
||||||
else:
|
else:
|
||||||
# Give admin access to directors of the corp
|
# Give admin access to directors of the corp
|
||||||
if application.corporation.id in corplist.filter(director=True).values_list('corporation__id', flat=True):
|
if application.corporation.id in corplist.filter(roles__name='roleDirector').values_list('corporation__id', flat=True):
|
||||||
return HR_ADMIN
|
return HR_ADMIN
|
||||||
|
|
||||||
# Give access to none director HR people access
|
# Give access to none director HR people access
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ class Command(NoArgsCommand):
|
|||||||
help = "Extracts a list of director's full API keys in CSV format for uploading to EDK"
|
help = "Extracts a list of director's full API keys in CSV format for uploading to EDK"
|
||||||
|
|
||||||
def handle_noargs(self, **options):
|
def handle_noargs(self, **options):
|
||||||
chars = EVEPlayerCharacter.objects.filter(director=True, eveaccount__api_keytype=API_KEYTYPE_FULL, eveaccount__api_status=API_STATUS_OK)
|
chars = EVEPlayerCharacter.objects.filter(roles__name='roleDirector', eveaccount__api_keytype=API_KEYTYPE_FULL, eveaccount__api_status=API_STATUS_OK)
|
||||||
donekeys = []
|
donekeys = []
|
||||||
|
|
||||||
i = 0
|
i = 0
|
||||||
|
|||||||
Reference in New Issue
Block a user