cleanup after merge

This commit is contained in:
Rodney Ewing
2013-05-27 08:39:34 -07:00
parent bcd10ad663
commit cdc6b571e3
4 changed files with 14 additions and 20 deletions

View File

@@ -34,19 +34,17 @@ def check_login(user, password):
return None
def get_user(form):
if 'username' in form.data:
username = form.username.data
user = User.query.filter(
or_(
User.username == username,
User.email == username,
)).first()
return user
def get_user(username):
user = User.query.filter(
or_(
User.username == username,
User.email == username,
)).first()
return user
def create_user(registration_form):
user = get_user(registration_form)
user = get_user(registration_form.username.data)
if not user and 'password' in registration_form:
user = User()
user.username = registration_form.username.data