Activate pending users when email confirmation is disabled
This commit is contained in:
parent
874e2e0a9c
commit
148f9b6f5e
2 changed files with 43 additions and 15 deletions
|
@ -90,6 +90,14 @@ class SiteSettings(models.Model):
|
|||
return get_absolute_url(uploaded)
|
||||
return urljoin(STATIC_FULL_URL, default_path)
|
||||
|
||||
def save(self, *args, **kwargs):
|
||||
"""if require_confirm_email is disabled, make sure no users are pending"""
|
||||
if not self.require_confirm_email:
|
||||
User.objects.filter(is_active=False, deactivation_reason="pending").update(
|
||||
is_active=True, deactivation_reason=None
|
||||
)
|
||||
super().save(*args, **kwargs)
|
||||
|
||||
|
||||
class SiteInvite(models.Model):
|
||||
"""gives someone access to create an account on the instance"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue