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
from cubicweb import mail, crypto
from cubicweb.view import StartupView
from cubicweb.selectors import anonymous_user
from cubicweb.web import Redirect, ValidationError, ProcessFormError
from cubicweb.web import controller, form, captcha
from cubicweb.web import formwidgets as fw, formfields as ff
......@@ -176,10 +177,13 @@ class RegistrationConfirmController(controller.Controller):
return self._cw.build_url('', __message=msg % self._cw.user.name())
class AnonUserLink(basecomponents.CookieLoginComponent):
def call(self):
super(AnonUserLink, self).call()
self.w(u'&nbsp;[<a class="logout" href="%s">%s</a>]' % (
class RegisterLink(basecomponents.HeaderComponent):
__regid__ = 'registration.registerlink'
__select__ = basecomponents.HeaderComponent.__select__ & anonymous_user()
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')))
## urls #######################################################################
......@@ -188,7 +192,3 @@ class RegistrationSimpleReqRewriter(urlrewrite.SimpleReqRewriter):
rules = [
('/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