Various fixes and changes, security problems fixed, bugs resolved.

* Application status is now policed through APPLICATION_STATUS_ROUTES.
* Blacklisted application cannot be accepted.
* Blacklists are checked case insensitively.
* The template now shows blacklist advisories
* Applications are no longer flagged as Blacklisted unless they have a blacklist entry
This commit is contained in:
2011-07-09 11:05:59 +01:00
parent 99a2c14fe6
commit 2b3db4b383
5 changed files with 37 additions and 18 deletions

View File

@@ -40,21 +40,21 @@ def blacklist_values(user):
blacklist.extend(bl_items.filter(type=BLACKLIST_TYPE_AUTH, value=user.username.lower()))
# Check EVE Related blacklists
evechars = EVEPlayerCharacter.objects.filter(eveaccount__user=user).select_related('corporation__alliance')
evechars = EVEPlayerCharacter.objects.filter(eveaccount__user=user).select_related('corporation', 'corporation__alliance')
# Check Character blacklists
characters = evechars.values_list('name', flat=True)
objs = bl_items.filter(type=BLACKLIST_TYPE_CHARACTER, value__in=characters)
objs = bl_items.filter(type=BLACKLIST_TYPE_CHARACTER, value__iregex=r'(' + '|'.join(characters) + ')')
blacklist.extend(objs)
# Check Corporation blacklists
corporations = evechars.values_list('corporation__name', flat=True)
objs = bl_items.filter(type=BLACKLIST_TYPE_CORPORATION, value__in=corporations)
objs = bl_items.filter(type=BLACKLIST_TYPE_CORPORATION, value__iregex=r'(' + '|'.join(corporations) + ')')
blacklist.extend(objs)
# Check Alliance blacklists
alliances = evechars.values_list('corporation__alliance__name', flat=True)
objs = bl_items.filter(type=BLACKLIST_TYPE_ALLIANCE, value__in=alliances)
objs = bl_items.filter(type=BLACKLIST_TYPE_ALLIANCE, value__iregex=r'(' + '|'.join([x for x in alliances if x]) + ')')
blacklist.extend(objs)
# Check API Key blacklists