mirror of
https://github.com/nikdoof/test-auth.git
synced 2025-12-17 03:39:25 +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,11 +44,13 @@ def blacklist_values(user):
|
|||||||
|
|
||||||
# Check Character blacklists
|
# Check Character blacklists
|
||||||
characters = evechars.values_list('name', flat=True)
|
characters = evechars.values_list('name', flat=True)
|
||||||
|
if len(characters):
|
||||||
objs = bl_items.filter(type=BLACKLIST_TYPE_CHARACTER, value__iregex=r'(' + '|'.join(characters) + ')')
|
objs = bl_items.filter(type=BLACKLIST_TYPE_CHARACTER, value__iregex=r'(' + '|'.join(characters) + ')')
|
||||||
blacklist.extend(objs)
|
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)
|
||||||
|
if len(corporations):
|
||||||
objs = bl_items.filter(type=BLACKLIST_TYPE_CORPORATION, value__iregex=r'(' + '|'.join(corporations) + ')')
|
objs = bl_items.filter(type=BLACKLIST_TYPE_CORPORATION, value__iregex=r'(' + '|'.join(corporations) + ')')
|
||||||
blacklist.extend(objs)
|
blacklist.extend(objs)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user