Force External Services Password on everyone

This commit is contained in:
2012-07-17 18:00:37 +01:00
parent 9458bc07b9
commit ab41cfe573
2 changed files with 6 additions and 2 deletions

View File

@@ -8,8 +8,9 @@
<h1>Change Services Password</h1> <h1>Change Services Password</h1>
</div> </div>
<p>This service will reset your password for all External Auth API Services. If you wish to continue please enter a new <p>Your Services Password allows you to login to various TEST services and other third party services (such as the Betting Emporium). It is highly recommend that you setup a password as soon as you create your Auth account.</p>
password below.</p>
<p>Please use a different password from your normal auth password, as this is inherently less secure due to the multiple applications using it.</p>
<form action="{% url sso-apipassword %}" method="post"> <form action="{% url sso-apipassword %}" method="post">
<fieldset> <fieldset>

View File

@@ -39,6 +39,9 @@ class ProfileView(LoginRequiredMixin, TemplateView):
def get(self, request, *args, **kwargs): def get(self, request, *args, **kwargs):
self.profile = self.get_profile(request.user) self.profile = self.get_profile(request.user)
if self.profile.api_service_password is None or self.profile.api_service_password == '':
messages.info(request, "Please set a External Services Password before continuing.")
return HttpResponseRedirect(reverse('sso-apipassword'))
if self.profile.primary_character is None and EVEPlayerCharacter.objects.filter(eveaccount__user=request.user).count(): if self.profile.primary_character is None and EVEPlayerCharacter.objects.filter(eveaccount__user=request.user).count():
return HttpResponseRedirect(reverse('sso-primarycharacterupdate')) return HttpResponseRedirect(reverse('sso-primarycharacterupdate'))
return super(ProfileView, self).get(request, *args, **kwargs) return super(ProfileView, self).get(request, *args, **kwargs)