Esempio n. 1
0
    def deactivate(self, request):
        form = DeactivateProfileForm(request.form)

        if form.validate_on_submit():
            if not request.user.check_password(form.password.data):
                form.password.errors = [_(u'The password was not correct.')]
            else:
                user = request.user
                get_auth_system().logout(request)
                user.deactivate()
                db.session.commit()
                request.flash(_(u'Your profile was deactivated successfully'),
                     success=True)
                return redirect(href('portal/index'))

        return {
            'form': form
        }
Esempio n. 2
0
 def register(self, request):
     return get_auth_system().register(request)
Esempio n. 3
0
 def logout(self, request):
     return get_auth_system().logout(request)