Commit 153f4339 authored by Bruno Renié's avatar Bruno Renié
Browse files

lint: replace lambdas with defs

parent f5617a05
......@@ -81,7 +81,9 @@ class PasswordRecoveryForm(forms.Form):
def get_user_by_both(self, username):
key = '__%sexact'
key = key % '' if self.case_sensitive else key % 'i'
f = lambda field: Q(**{field + key: username})
def f(field):
return Q(**{field + key: username})
filters = f('username') | f('email')
User = get_user_model()
try:
......
......@@ -2,7 +2,9 @@ try:
from django.contrib.auth import get_user_model
except ImportError:
from django.contrib.auth.models import User
get_user_model = lambda: User # noqa
def get_user_model():
return User
def get_username(user):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment