mirror of
https://github.com/nikdoof/test-auth.git
synced 2025-12-16 19:33:44 +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
|
# Check Character blacklists
|
||||||
characters = evechars.values_list('name', flat=True)
|
characters = evechars.values_list('name', flat=True)
|
||||||
objs = bl_items.filter(type=BLACKLIST_TYPE_CHARACTER, value__iregex=r'(' + '|'.join(characters) + ')')
|
if len(characters):
|
||||||
blacklist.extend(objs)
|
objs = bl_items.filter(type=BLACKLIST_TYPE_CHARACTER, value__iregex=r'(' + '|'.join(characters) + ')')
|
||||||
|
blacklist.extend(objs)
|
||||||
|
|
||||||
# Check Corporation blacklists
|
# Check Corporation blacklists
|
||||||
corporations = evechars.values_list('corporation__name', flat=True)
|
corporations = evechars.values_list('corporation__name', flat=True)
|
||||||
objs = bl_items.filter(type=BLACKLIST_TYPE_CORPORATION, value__iregex=r'(' + '|'.join(corporations) + ')')
|
if len(corporations):
|
||||||
blacklist.extend(objs)
|
objs = bl_items.filter(type=BLACKLIST_TYPE_CORPORATION, value__iregex=r'(' + '|'.join(corporations) + ')')
|
||||||
|
blacklist.extend(objs)
|
||||||
|
|
||||||
# Check Alliance blacklists
|
# Check Alliance blacklists
|
||||||
alliances = [x for x in evechars.values_list('corporation__alliance__name', flat=True) if x]
|
alliances = [x for x in evechars.values_list('corporation__alliance__name', flat=True) if x]
|
||||||
|
|||||||
Reference in New Issue
Block a user