Example #1
0
 def __init__(self, lst, item):
     if item.title:
         title = u'« %s » a été donné' % item.title
     else:
         title = u'Le cadeau a été donné'
     BasePage.__init__(self, title)
     self.list = lst
     self.item = item
     return
Example #2
0
    def renderHTTP(self, ctx):
        """Handle HTTP requests."""
        srv = IService(ctx)
        request = IRequest(ctx)

        current = must_user(ctx)
        user = srv.validate_challenge(  # pylint: disable-msg=E1101
            self.challenge, current.session)

        if user:
            message(ctx, u'Bienvenue, %s' % (user.email, ))
            request.redirect("/")
            request.finish()
            return ''

        # Some people simply reuse invitations: don't complain if they
        # are already connected, just redirect them to the main page.
        avatar = maybe_user(ctx)
        if avatar.identified:
            request.redirect("/")
            request.finish()
            return ''

        # pylint: disable-msg=E1101
        self.contentTags = [
            T.h1[u"Cette clé n'est pas valable"],
            T.p[u"Vous pouvez obtenir une nouvelle clé par e-mail.",
                T.div(_class="editable bl")[T.div(_class="br")[T.div(
                    _class="tl")[T.div(_class="tr")[T.div(
                        _class="edcontent")[login.LoginFragment(
                            original=login.LoginInfo(
                                force_reconnect=True))], ]]]]]
        ]

        return BasePage.renderHTTP(self, ctx)
Example #3
0
    def renderHTTP(self, ctx):  # pylint: disable-msg=C0103
        """Handle HTTP requests."""
        request = IRequest(ctx)

        if request.method == 'POST':  # pylint: disable-msg=E1101
            session.destroy_session(ctx)
            request.redirect('/')
            return ''
        return BasePage.renderHTTP(self, ctx)
Example #4
0
    def locateChild(self, ctx, segments):
        """Handle the URL hierarchy at the root point."""
        ctx.remember(The404Page(), inevow.ICanHandleNotFound)
        ctx.remember(The500Page(), inevow.ICanHandleException)

        if segments[0] == 'challenge' and len(segments) == 2:
            return Challenge(segments[1]), []

        return BasePage.locateChild(self, ctx, segments)
Example #5
0
 def __init__(self):
     BasePage.__init__(self, 'Envoyer des invitations')
     widget.RoundedBoxMixin.__init__(self)
Example #6
0
 def __init__(self, lst):
     widget.RoundedBoxMixin.__init__(self)
     BasePage.__init__(self, lst.name or 'Liste sans nom')
     self.list = lst
Example #7
0
 def __init__(self, lst):
     BasePage.__init__(self, lst.name or 'Liste sans nom')
     self.list = lst
Example #8
0
    def __init__(self, challenge):
        BasePage.__init__(self)

        self.challenge = challenge
        return