Change codebase to query or create correct User model
The code base had many references to User.username and other specific to LocalUser attributes as that was the way it use to exist. This updates those to query on the generic User model but filtering by attributes on the LocalUser.
This commit is contained in:
@@ -18,7 +18,7 @@ import six
|
||||
|
||||
from mediagoblin import mg_globals, messages
|
||||
from mediagoblin.auth.tools import register_user
|
||||
from mediagoblin.db.models import User
|
||||
from mediagoblin.db.models import User, LocalUser
|
||||
from mediagoblin.decorators import allow_registration, auth_enabled
|
||||
from mediagoblin.plugins.ldap import forms
|
||||
from mediagoblin.plugins.ldap.tools import LDAP
|
||||
@@ -38,8 +38,9 @@ def login(request):
|
||||
login_form.password.data)
|
||||
|
||||
if username:
|
||||
user = User.query.filter_by(
|
||||
username=username).first()
|
||||
user = User.query.filter(
|
||||
LocalUser.username==username
|
||||
).first()
|
||||
|
||||
if user:
|
||||
# set up login in session
|
||||
|
||||
Reference in New Issue
Block a user