Correct SeAT API logic (#860)

* Do not attempt to change user email on SeAT if unchanged.
This prevents HTTP422 from being raised on password resets.

*Delete users on deactivation.
The existing disable user logic does nothing and results in a HTTP500.
It's safe to delete users entirely - the API keys are retained.

Fixes #844
This commit is contained in:
Adarnof
2017-09-08 13:42:35 -04:00
committed by GitHub
parent 3f454743a9
commit 0ac0f71fef
3 changed files with 18 additions and 29 deletions

View File

@@ -28,7 +28,7 @@ class SeatTasks:
@classmethod
def delete_user(cls, user, notify_user=False):
if cls.has_account(user) and SeatManager.disable_user(user.seat.username):
if cls.has_account(user) and SeatManager.delete_user(user.seat.username):
user.seat.delete()
logger.info("Successfully deactivated SeAT for user %s" % user)
if notify_user: