Skip to content

Commit

Permalink
Delete from LDAP as we delete a user instance
Browse files Browse the repository at this point in the history
  • Loading branch information
txels committed Mar 5, 2024
1 parent 35b4fb9 commit a88855f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions humans/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ def save(self, *args, **kwargs):
if password is not None:
self.__ldap__set_password(password)

def delete(self, *args, **kwargs):
directory.delete_user(directory.connect(), self.username)
super().delete(*args, **kwargs)

def __ldap__save(self):
max_user_id = User.objects.aggregate(Max("id"))["id__max"] or 1
connection = directory.connect()
Expand Down

0 comments on commit a88855f

Please sign in to comment.