Blinkenbunt Account Manager
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
from django.db import models
|
|
|
|
from django.contrib.auth.models import User
|
|
|
|
from django.contrib.auth.hashers import make_password
|
|
|
|
|
|
|
|
|
|
|
|
class Account(models.Model):
|
|
|
|
user = models.OneToOneField(User, on_delete=models.CASCADE)
|
|
|
|
hashed_email = models.CharField(max_length=128, blank=True)
|
|
|
|
|
|
|
|
def __str__(self):
|
|
|
|
return '%s' % (self.user.username)
|
|
|
|
|
|
|
|
def set_hashed_email(self, email):
|
|
|
|
self.hashed_email = make_password(email)
|