modified get_user function to take kwargs instead of username
This commit is contained in:
@@ -16,8 +16,9 @@
|
||||
from mediagoblin.tools.pluginapi import hook_handle, hook_runall
|
||||
|
||||
|
||||
def get_user(username):
|
||||
return hook_handle("auth_get_user", username)
|
||||
def get_user(**kwargs):
|
||||
""" Takes a kwarg such as username and returns a user object """
|
||||
return hook_handle("auth_get_user", **kwargs)
|
||||
|
||||
|
||||
def create_user(register_form):
|
||||
|
||||
@@ -199,7 +199,7 @@ def register_user(request, register_form):
|
||||
|
||||
|
||||
def check_login_simple(username, password):
|
||||
user = auth.get_user(username)
|
||||
user = auth.get_user(username=username)
|
||||
if not user:
|
||||
_log.info("User %r not found", username)
|
||||
auth.fake_login_attempt()
|
||||
|
||||
Reference in New Issue
Block a user