Skip to content

Commit

Permalink
Use h.url_for and qualified=True for reset mails
Browse files Browse the repository at this point in the history
  • Loading branch information
Zharktas authored and smotornyuk committed Mar 22, 2017
1 parent 39ba8a4 commit bdd591c
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions ckan/lib/mailer.py
Expand Up @@ -133,11 +133,12 @@ def get_invite_body(user):
return invite_message.format(**d)

def get_reset_link(user):
return urljoin(g.site_url,
h.url_for(controller='user',
action='perform_reset',
id=user.id,
key=user.reset_key))
return h.url_for(controller='user',
action='perform_reset',
id=user.id,
key=user.reset_key,
qualified=True)


def send_reset_link(user):
create_reset_key(user)
Expand All @@ -164,6 +165,3 @@ def verify_reset_link(user, key):
if not user.reset_key or len(user.reset_key) < 5:
return False
return key.strip() == user.reset_key



0 comments on commit bdd591c

Please sign in to comment.