Ensure correct corp and alliance groups are assigned.

Closes #650
This commit is contained in:
Adarnof 2017-01-15 22:49:33 -05:00
parent 5bbaef4476
commit 6c4e8ec2d1
3 changed files with 5 additions and 2 deletions

View File

@ -31,4 +31,4 @@ def post_save_user(sender, instance, created, *args, **kwargs):
# ensure all users have a model # ensure all users have a model
if created: if created:
AuthServicesInfo.objects.get_or_create(user=instance) AuthServicesInfo.objects.get_or_create(user=instance)

View File

@ -110,6 +110,8 @@ def set_state(user):
auth.state = state auth.state = state
auth.save() auth.save()
notify(user, "Membership State Change", message="You membership state has been changed to %s" % state) notify(user, "Membership State Change", message="You membership state has been changed to %s" % state)
assign_corp_group(auth)
assign_alliance_group(auth)
def assign_corp_group(auth): def assign_corp_group(auth):

View File

@ -108,7 +108,8 @@ def sso_login(request, token):
else: else:
messages.error(request, 'Your account has been disabled.') messages.error(request, 'Your account has been disabled.')
else: else:
messages.warning(request, 'Authenticated character has no owning account. Please log in with username and password.') messages.warning(request,
'Authenticated character has no owning account. Please log in with username and password.')
except EveCharacter.DoesNotExist: except EveCharacter.DoesNotExist:
messages.error(request, 'No account exists with the authenticated character. Please create an account first.') messages.error(request, 'No account exists with the authenticated character. Please create an account first.')
return redirect(login_user) return redirect(login_user)