1👍
✅
You will need to override save method for this and save user model whenver the email is confirmed.
class Profile(models.Model):
user = models.OneToOneField(User, on_delete=models.CASCADE)
unique_id = models.UUIDField(null=False, blank=False, default=uuid.uuid4, unique=True, editable=False)
email_confirmed = models.BooleanField(default=False)
def __str__(self):
return self.user.username
def save(self,*args,**kwargs):
if self.email_confirmed:
self.user.is_active=True
self.user.save()
super(Profile,self).save(*args,**kwargs)
I have not implemented but I think this works.
Source:stackexchange.com