mirror of
https://github.com/nikdoof/test-auth.git
synced 2025-12-14 06:42:16 +00:00
Allow for assigned services outside of the corp/alliance structure
This commit is contained in:
@@ -4,7 +4,7 @@ from django import forms
|
||||
from django.contrib.auth.models import User
|
||||
|
||||
import settings
|
||||
from eve_api.models.api_player import EVEAccount, EVEPlayerCharacter
|
||||
from eve_api.models.api_player import EVEAccount, EVEPlayerCharacter, EVEPlayerCorporation
|
||||
from sso.models import ServiceAccount, Service
|
||||
from reddit.models import RedditAccount
|
||||
|
||||
@@ -51,7 +51,8 @@ def UserServiceAccountForm(user):
|
||||
self.fields['password'] = self.password
|
||||
|
||||
def clean(self):
|
||||
|
||||
# If the service's assigned groups are linked to corps, do a character/corp check
|
||||
if len(EVEPlayerCorporation.objects.filter(group__in=self.cleaned_data['service'].groups.all())):
|
||||
corp_group = self.cleaned_data['character'].corporation.group
|
||||
if self.cleaned_data['character'].corporation.alliance:
|
||||
alliance_group = self.cleaned_data['character'].corporation.alliance.group
|
||||
|
||||
Reference in New Issue
Block a user