Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cubicweb
cubes
registration
Commits
4ec8b826e028
Commit
25a517df
authored
Oct 21, 2010
by
Sylvain Thénault
Browse files
fix 3.10 compat, closes #1347945
--HG-- branch : stable
parent
7346f7f35a9a
Changes
1
Hide whitespace changes
Inline
Side-by-side
views.py
View file @
4ec8b826
...
...
@@ -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
' [<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
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment