mirror of
https://github.com/nikdoof/test-auth.git
synced 2025-12-14 14:52:15 +00:00
Don't check the blacklist if we've got nothing to check, stops stupid all blacklists errors
This commit is contained in:
@@ -44,13 +44,15 @@ def blacklist_values(user):
|
||||
|
||||
# Check Character blacklists
|
||||
characters = evechars.values_list('name', flat=True)
|
||||
objs = bl_items.filter(type=BLACKLIST_TYPE_CHARACTER, value__iregex=r'(' + '|'.join(characters) + ')')
|
||||
blacklist.extend(objs)
|
||||
if len(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__iregex=r'(' + '|'.join(corporations) + ')')
|
||||
blacklist.extend(objs)
|
||||
if len(corporations):
|
||||
objs = bl_items.filter(type=BLACKLIST_TYPE_CORPORATION, value__iregex=r'(' + '|'.join(corporations) + ')')
|
||||
blacklist.extend(objs)
|
||||
|
||||
# Check Alliance blacklists
|
||||
alliances = [x for x in evechars.values_list('corporation__alliance__name', flat=True) if x]
|
||||
|
||||
Reference in New Issue
Block a user