diff --git a/hr/app_defines.py b/hr/app_defines.py index 23ea5a3..523f751 100644 --- a/hr/app_defines.py +++ b/hr/app_defines.py @@ -51,6 +51,7 @@ BLACKLIST_TYPE_CHARACTER = 1 BLACKLIST_TYPE_CORPORATION = 2 BLACKLIST_TYPE_ALLIANCE = 3 BLACKLIST_TYPE_EMAIL = 4 +BLACKLIST_TYPE_AUTH = 5 BLACKLIST_TYPE_CHOICES = ( (BLACKLIST_TYPE_REDDIT, 'Reddit Account'), @@ -58,4 +59,5 @@ BLACKLIST_TYPE_CHOICES = ( (BLACKLIST_TYPE_CORPORATION, 'Corporation'), (BLACKLIST_TYPE_ALLIANCE, 'Alliance'), (BLACKLIST_TYPE_EMAIL, 'Email Address'), + (BLACKLIST_TYPE_AUTH, 'Auth Account'), ) diff --git a/hr/models.py b/hr/models.py index c041145..6394723 100644 --- a/hr/models.py +++ b/hr/models.py @@ -35,10 +35,15 @@ class Application(models.Model): # Check Reddit blacklists reddit_uids = self.user.redditaccount_set.all().values_list('username') reddit = [a[0].lower() for a in reddit_uids if a and a[0]] - objs = bl_items.filter(type=BLACKLIST_TYPE_REDDIT, value__in=reddit) blacklist.extend(objs) + # Check email blacklists + blacklist.extend(bl_items.filter(type=BLACKLIST_TYPE_EMAIL, value=self.user.email.lower())) + + # Check Auth blacklists + blacklist.extend(bl_items.filter(type=BLACKLIST_TYPE_AUTH, value=self.user.username.lower())) + # Check EVE Related blacklists evechars = EVEPlayerCharacter.objects.filter(eveaccount__user=self.user).select_related('corporation__alliance')