diff --git a/app/hr/views.py b/app/hr/views.py index 056ce99..1c800d3 100644 --- a/app/hr/views.py +++ b/app/hr/views.py @@ -39,7 +39,7 @@ def check_permissions(user, application=None): corplist = EVEPlayerCharacter.objects.filter(eveaccount__user=user,corporation__applications=True) 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 else: if application.user == user: @@ -48,7 +48,7 @@ def check_permissions(user, application=None): return HR_ADMIN else: # 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 # Give access to none director HR people access diff --git a/app/tools/management/commands/edk-apikeys.py b/app/tools/management/commands/edk-apikeys.py index fecc0a1..9b0c605 100755 --- a/app/tools/management/commands/edk-apikeys.py +++ b/app/tools/management/commands/edk-apikeys.py @@ -8,7 +8,7 @@ class Command(NoArgsCommand): help = "Extracts a list of director's full API keys in CSV format for uploading to EDK" 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 = [] i = 0