mirror of
https://github.com/nikdoof/test-auth.git
synced 2025-12-14 06:42:16 +00:00
Remove unneeded checks
This commit is contained in:
@@ -80,10 +80,6 @@ class ServiceAccount(models.Model):
|
|||||||
|
|
||||||
api = get_api(self.service.api)
|
api = get_api(self.service.api)
|
||||||
|
|
||||||
if api.corp_only:
|
|
||||||
if not self.user.get_profile().corp_user:
|
|
||||||
raise CorporateOnlyService()
|
|
||||||
|
|
||||||
if self.active:
|
if self.active:
|
||||||
if not api.check_user(self.username):
|
if not api.check_user(self.username):
|
||||||
api.add_user(self.username, self.password)
|
api.add_user(self.username, self.password)
|
||||||
@@ -93,9 +89,6 @@ class ServiceAccount(models.Model):
|
|||||||
if api.check_user(self.username):
|
if api.check_user(self.username):
|
||||||
api.delete_user(self.username)
|
api.delete_user(self.username)
|
||||||
|
|
||||||
if self.user.get_profile().corp_user:
|
|
||||||
api.set_corp(self.username)
|
|
||||||
|
|
||||||
# All went OK, save to the DB
|
# All went OK, save to the DB
|
||||||
return models.Model.save(self)
|
return models.Model.save(self)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user