mirror of
https://github.com/nikdoof/test-auth.git
synced 2025-12-14 06:42:16 +00:00
More error checking on Jabber, also presents error message to user if service addition fails
This commit is contained in:
@@ -17,6 +17,9 @@ class CorporateOnlyService(Exception):
|
||||
class ExistingUser(Exception):
|
||||
pass
|
||||
|
||||
class ServiceError(Exception):
|
||||
pass
|
||||
|
||||
## Models
|
||||
|
||||
class SSOUser(models.Model):
|
||||
@@ -129,6 +132,8 @@ class ServiceAccount(models.Model):
|
||||
|
||||
reddit = RedditAccount.objects.filter(user=self.user)
|
||||
self.service_uid = api.add_user(self.username, self.password, user=self.user, character=self.character, eveapi=eveapi, reddit=reddit)
|
||||
if not self.service_uid:
|
||||
raise ServiceError('Error occured while trying to create the Service Account, please try again later')
|
||||
else:
|
||||
raise ExistingUser('Username %s has already been took' % self.username)
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user