Commit 25a517df authored by Sylvain Thénault's avatar Sylvain Thénault
Browse files

fix 3.10 compat, closes #1347945

--HG--
branch : stable
parent 7346f7f35a9a
...@@ -13,6 +13,7 @@ from yams.schema import role_name ...@@ -13,6 +13,7 @@ from yams.schema import role_name
from cubicweb import mail, crypto from cubicweb import mail, crypto
from cubicweb.view import StartupView from cubicweb.view import StartupView
from cubicweb.selectors import anonymous_user
from cubicweb.web import Redirect, ValidationError, ProcessFormError from cubicweb.web import Redirect, ValidationError, ProcessFormError
from cubicweb.web import controller, form, captcha from cubicweb.web import controller, form, captcha
from cubicweb.web import formwidgets as fw, formfields as ff from cubicweb.web import formwidgets as fw, formfields as ff
...@@ -176,10 +177,13 @@ class RegistrationConfirmController(controller.Controller): ...@@ -176,10 +177,13 @@ class RegistrationConfirmController(controller.Controller):
return self._cw.build_url('', __message=msg % self._cw.user.name()) return self._cw.build_url('', __message=msg % self._cw.user.name())
class AnonUserLink(basecomponents.CookieLoginComponent): class RegisterLink(basecomponents.HeaderComponent):
def call(self): __regid__ = 'registration.registerlink'
super(AnonUserLink, self).call() __select__ = basecomponents.HeaderComponent.__select__ & anonymous_user()
self.w(u'&nbsp;[<a class="logout" href="%s">%s</a>]' % ( context = 'header-right'
def render(self, w):
w(u'[<a class="logout" href="%s">%s</a>]' % (
self._cw.build_url('register'), self._cw._('i18n_register_user'))) self._cw.build_url('register'), self._cw._('i18n_register_user')))
## urls ####################################################################### ## urls #######################################################################
...@@ -188,7 +192,3 @@ class RegistrationSimpleReqRewriter(urlrewrite.SimpleReqRewriter): ...@@ -188,7 +192,3 @@ class RegistrationSimpleReqRewriter(urlrewrite.SimpleReqRewriter):
rules = [ rules = [
('/register', dict(vid='registration')), ('/register', dict(vid='registration')),
] ]
def registration_callback(vreg):
vreg.register_all(globals().values(), __name__, (AnonUserLink,))
vreg.register_and_replace(AnonUserLink, basecomponents.CookieLoginComponent)
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