Commit 3a88a98b authored by PCoder's avatar PCoder

Add logger + improve the way we build password reset url

parent d0faf781
......@@ -15,6 +15,10 @@ from .models import ResetToken
from .forms import LoginForm
from .ungleich_ldap import LdapManager
import logging
logger = logging.getLogger(__name__)
# Imports for the extra stuff not in django
from base64 import b64encode, b64decode
......@@ -277,7 +281,10 @@ class ResetPassword(View):
newdbentry = ResetToken(user=user, token=token, creation=epochutc)
newdbentry.save()
# set up the link
link = (base_url + '/reset/%s/%s/') % (userpart.decode('utf-8'), token)
link = "{base_url}/reset/{user}/{token}/".format(
base_url=base_url,user=userpart.decode('utf-8'),token=token
)
logger.debug("User reset url is {}".format(link))
return link
......
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