Fix password reset problem (was missing error_handler)
This commit is contained in:
parent
844999b0ab
commit
152f5e7ba0
1 changed files with 12 additions and 0 deletions
|
@ -294,6 +294,7 @@ https://admin.fedoraproject.org/accounts/user/verifyemail/%s
|
||||||
|
|
||||||
# TODO: This took about 55 seconds for me to load - might want to limit it to the right accounts (systems user, accounts group)
|
# TODO: This took about 55 seconds for me to load - might want to limit it to the right accounts (systems user, accounts group)
|
||||||
@identity.require(turbogears.identity.not_anonymous())
|
@identity.require(turbogears.identity.not_anonymous())
|
||||||
|
@error_handler(error)
|
||||||
@expose(template="fas.templates.user.list", allow_json=True)
|
@expose(template="fas.templates.user.list", allow_json=True)
|
||||||
def list(self, search="a*"):
|
def list(self, search="a*"):
|
||||||
'''List users
|
'''List users
|
||||||
|
@ -317,6 +318,7 @@ https://admin.fedoraproject.org/accounts/user/verifyemail/%s
|
||||||
return dict(people=people, search=search)
|
return dict(people=people, search=search)
|
||||||
|
|
||||||
@identity.require(turbogears.identity.not_anonymous())
|
@identity.require(turbogears.identity.not_anonymous())
|
||||||
|
@error_handler(error)
|
||||||
@expose(format='json')
|
@expose(format='json')
|
||||||
def email_list(self, search='*'):
|
def email_list(self, search='*'):
|
||||||
re_search = re.sub(r'\*', r'%', search).lower()
|
re_search = re.sub(r'\*', r'%', search).lower()
|
||||||
|
@ -327,6 +329,7 @@ https://admin.fedoraproject.org/accounts/user/verifyemail/%s
|
||||||
return dict(emails=emails)
|
return dict(emails=emails)
|
||||||
|
|
||||||
@identity.require(turbogears.identity.not_anonymous())
|
@identity.require(turbogears.identity.not_anonymous())
|
||||||
|
@error_handler(error)
|
||||||
@expose(template='fas.templates.user.verifyemail')
|
@expose(template='fas.templates.user.verifyemail')
|
||||||
def verifyemail(self, token, cancel=False):
|
def verifyemail(self, token, cancel=False):
|
||||||
username = turbogears.identity.current.user_name
|
username = turbogears.identity.current.user_name
|
||||||
|
@ -347,6 +350,7 @@ https://admin.fedoraproject.org/accounts/user/verifyemail/%s
|
||||||
return dict(person=person, token=token)
|
return dict(person=person, token=token)
|
||||||
|
|
||||||
@identity.require(turbogears.identity.not_anonymous())
|
@identity.require(turbogears.identity.not_anonymous())
|
||||||
|
@error_handler(error)
|
||||||
@expose()
|
@expose()
|
||||||
def setemail(self, token):
|
def setemail(self, token):
|
||||||
username = turbogears.identity.current.user_name
|
username = turbogears.identity.current.user_name
|
||||||
|
@ -369,6 +373,7 @@ https://admin.fedoraproject.org/accounts/user/verifyemail/%s
|
||||||
turbogears.redirect('/user/view/%s' % username)
|
turbogears.redirect('/user/view/%s' % username)
|
||||||
return dict()
|
return dict()
|
||||||
|
|
||||||
|
@error_handler(error)
|
||||||
@expose(template='fas.templates.user.new')
|
@expose(template='fas.templates.user.new')
|
||||||
def new(self):
|
def new(self):
|
||||||
if turbogears.identity.not_anonymous():
|
if turbogears.identity.not_anonymous():
|
||||||
|
@ -443,6 +448,7 @@ forward to working with you!
|
||||||
return dict()
|
return dict()
|
||||||
|
|
||||||
@identity.require(turbogears.identity.not_anonymous())
|
@identity.require(turbogears.identity.not_anonymous())
|
||||||
|
@error_handler(error)
|
||||||
@expose(template="fas.templates.user.changepass")
|
@expose(template="fas.templates.user.changepass")
|
||||||
def changepass(self):
|
def changepass(self):
|
||||||
return dict()
|
return dict()
|
||||||
|
@ -475,6 +481,7 @@ forward to working with you!
|
||||||
turbogears.flash(_("Your password could not be changed."))
|
turbogears.flash(_("Your password could not be changed."))
|
||||||
return dict()
|
return dict()
|
||||||
|
|
||||||
|
@error_handler(error)
|
||||||
@expose(template="fas.templates.user.resetpass")
|
@expose(template="fas.templates.user.resetpass")
|
||||||
def resetpass(self):
|
def resetpass(self):
|
||||||
if turbogears.identity.not_anonymous():
|
if turbogears.identity.not_anonymous():
|
||||||
|
@ -483,6 +490,7 @@ forward to working with you!
|
||||||
return dict()
|
return dict()
|
||||||
|
|
||||||
#TODO: Validate
|
#TODO: Validate
|
||||||
|
@error_handler(error)
|
||||||
@expose(template="fas.templates.user.resetpass")
|
@expose(template="fas.templates.user.resetpass")
|
||||||
def sendtoken(self, username, email, encrypted=False):
|
def sendtoken(self, username, email, encrypted=False):
|
||||||
import turbomail
|
import turbomail
|
||||||
|
@ -549,6 +557,7 @@ https://admin.fedoraproject.org/accounts/user/verifypass/%(user)s/%(token)s
|
||||||
turbogears.redirect('/login')
|
turbogears.redirect('/login')
|
||||||
return dict()
|
return dict()
|
||||||
|
|
||||||
|
@error_handler(error)
|
||||||
@expose(template="fas.templates.user.newpass")
|
@expose(template="fas.templates.user.newpass")
|
||||||
# TODO: Validator
|
# TODO: Validator
|
||||||
def newpass(self, username, token, password=None, passwordcheck=None):
|
def newpass(self, username, token, password=None, passwordcheck=None):
|
||||||
|
@ -564,6 +573,7 @@ https://admin.fedoraproject.org/accounts/user/verifypass/%(user)s/%(token)s
|
||||||
return dict()
|
return dict()
|
||||||
return dict(person=person, token=token)
|
return dict(person=person, token=token)
|
||||||
|
|
||||||
|
@error_handler(error)
|
||||||
@expose(template="fas.templates.user.verifypass")
|
@expose(template="fas.templates.user.verifypass")
|
||||||
# TODO: Validator
|
# TODO: Validator
|
||||||
def verifypass(self, username, token, cancel=False):
|
def verifypass(self, username, token, cancel=False):
|
||||||
|
@ -583,6 +593,7 @@ https://admin.fedoraproject.org/accounts/user/verifypass/%(user)s/%(token)s
|
||||||
return dict()
|
return dict()
|
||||||
return dict(person=person, token=token)
|
return dict(person=person, token=token)
|
||||||
|
|
||||||
|
@error_handler(error)
|
||||||
@expose()
|
@expose()
|
||||||
@validate(validators=UserResetPassword())
|
@validate(validators=UserResetPassword())
|
||||||
def setnewpass(self, username, token, password, passwordcheck):
|
def setnewpass(self, username, token, password, passwordcheck):
|
||||||
|
@ -607,6 +618,7 @@ https://admin.fedoraproject.org/accounts/user/verifypass/%(user)s/%(token)s
|
||||||
return dict()
|
return dict()
|
||||||
|
|
||||||
@identity.require(turbogears.identity.not_anonymous())
|
@identity.require(turbogears.identity.not_anonymous())
|
||||||
|
@error_handler(error)
|
||||||
@expose(template="genshi-text:fas.templates.user.cert", format="text", content_type='text/plain; charset=utf-8')
|
@expose(template="genshi-text:fas.templates.user.cert", format="text", content_type='text/plain; charset=utf-8')
|
||||||
def gencert(self):
|
def gencert(self):
|
||||||
username = turbogears.identity.current.user_name
|
username = turbogears.identity.current.user_name
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue