Merge branch 'master' of github.com:IceCTF/new-platform

master
James Sigurðarson 2016-07-12 20:06:36 +00:00
commit 7d4d14f4da
1 changed files with 3 additions and 1 deletions

View File

@ -26,7 +26,7 @@ class Team(BaseModel):
class User(BaseModel):
username = CharField(unique=True, index=True)
email = CharField(unique=True, index=True)
email = CharField(index=True)
email_confirmed = BooleanField(default=False)
email_confirmation_key = CharField()
password = CharField(null = True)
@ -37,6 +37,8 @@ class User(BaseModel):
first_login = BooleanField(default=True)
restricts = TextField(default="")
team = ForeignKeyField(Team, related_name="members")
banned = BooleanField(default=False)
password_reset_token = CharField(null = True)
def setPassword(self, pw):
self.password = bcrypt.hashpw(pw.encode("utf-8"), bcrypt.gensalt())