Fixed some selects missed since the director roles selection changes

This commit is contained in:
2011-03-16 08:46:19 +00:00
parent 86ffca1781
commit f169942c74
2 changed files with 3 additions and 3 deletions

View File

@@ -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

View File

@@ -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