Set deactivation date
This commit is contained in:
parent
430554444f
commit
3e7847e645
|
@ -270,6 +270,11 @@ class User(OrderedCollectionPageMixin, AbstractUser):
|
||||||
|
|
||||||
# this user already exists, no need to populate fields
|
# this user already exists, no need to populate fields
|
||||||
if not created:
|
if not created:
|
||||||
|
if self.is_active:
|
||||||
|
self.deactivation_date = None
|
||||||
|
elif not self.deactivation_date:
|
||||||
|
self.deactivation_date = timezone.now()
|
||||||
|
|
||||||
super().save(*args, **kwargs)
|
super().save(*args, **kwargs)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue