Allow for assigned services outside of the corp/alliance structure

This commit is contained in:
2010-06-01 22:06:49 +01:00
parent 70944b3c20
commit dafd5440a1

View File

@@ -4,7 +4,7 @@ from django import forms
from django.contrib.auth.models import User from django.contrib.auth.models import User
import settings 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 sso.models import ServiceAccount, Service
from reddit.models import RedditAccount from reddit.models import RedditAccount
@@ -51,7 +51,8 @@ def UserServiceAccountForm(user):
self.fields['password'] = self.password self.fields['password'] = self.password
def clean(self): 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 corp_group = self.cleaned_data['character'].corporation.group
if self.cleaned_data['character'].corporation.alliance: if self.cleaned_data['character'].corporation.alliance:
alliance_group = self.cleaned_data['character'].corporation.alliance.group alliance_group = self.cleaned_data['character'].corporation.alliance.group