Merge branch 'master' of ssh://bitbucket.org/yackob03/quay

This commit is contained in:
yackob03 2014-01-16 16:19:48 -05:00
commit d5bbea9fb2
3 changed files with 5 additions and 6 deletions

View file

@ -439,9 +439,9 @@ def get_matching_users(username_prefix, robot_namespace=None,
return (MatchingUserResult(*args) for args in query.tuples().limit(10))
def verify_user(username, password):
def verify_user(username_or_email, password):
try:
fetched = User.get(User.username == username)
fetched = User.get((User.username == username_or_email) | (User.email == username_or_email))
except User.DoesNotExist:
return None

View file

@ -312,12 +312,11 @@ def signin_user():
return conduct_signin(username, password)
def conduct_signin(username, password):
#TODO Allow email login
def conduct_signin(username_or_email, password):
needs_email_verification = False
invalid_credentials = False
verified = model.verify_user(username, password)
verified = model.verify_user(username_or_email, password)
if verified:
if common_login(verified):
return make_response('Success', 200)

View file

@ -1,7 +1,7 @@
<div class="signin-form-element">
<form class="form-signin" ng-submit="signin();">
<input type="text" class="form-control input-lg" name="username"
placeholder="Username" ng-model="user.username" autofocus>
placeholder="Username or E-mail Address" ng-model="user.username" autofocus>
<input type="password" class="form-control input-lg" name="password"
placeholder="Password" ng-model="user.password">
<button class="btn btn-lg btn-primary btn-block" type="submit">Sign In</button>