Exemplo n.º 1
0
    def get(self, id):
        event = self._event(id)
        if not event:
            return
        if event.state < EVENT_STATE_BEGIN:
            return self.redirect('/')
        current_user_id = self.current_user_id
        state = event_joiner_state(id, current_user_id)
        if state < EVENT_JOIN_STATE_NEW:
            return self.redirect('/%s' % id)

        return self.render(event=event, state=state)
Exemplo n.º 2
0
    def get(self, id):
        event = self._event(id)
        if not event:
            return
        if event.state < EVENT_STATE_BEGIN:
            return self.redirect('/')
        current_user_id = self.current_user_id
        state = event_joiner_state(id, current_user_id)
        if state < EVENT_JOIN_STATE_NEW:
            return self.redirect('/%s'%id)

        return self.render(event=event, state=state)
Exemplo n.º 3
0
def _event(self, id):
    current_user = self.current_user
    if current_user.state < ZSITE_STATE_VERIFY:
        return self.redirect('/i/verify')
    current_user_id = self.current_user_id
    self.event = event = EventBase._event(self, id)
    self.error = []
    if event:
        if event.zsite_id == current_user_id:
            return self.redirect('/event/check/%s' % id)
        if event.state == EVENT_STATE_END:
            return self.redirect(event.link)
        if event_joiner_state(id, current_user_id) < EVENT_JOIN_STATE_NEW:
            return event
        event_link = '/event/%s/state' % event.id
        return self.redirect(event_link)
Exemplo n.º 4
0
def _event(self, id):
    current_user = self.current_user
    if current_user.state < ZSITE_STATE_VERIFY:
        return self.redirect('/i/verify')
    current_user_id = self.current_user_id
    self.event = event = EventBase._event(self, id)
    self.error = []
    if event:
        if event.zsite_id == current_user_id:
            return self.redirect('/event/check/%s'%id)
        if event.state == EVENT_STATE_END:
            return self.redirect(event.link)
        if event_joiner_state(id, current_user_id) < EVENT_JOIN_STATE_NEW:
            return event
        event_link = '/event/%s/state'%event.id
        return self.redirect(event_link)
Exemplo n.º 5
0
    def _event(self, event_id):
        self.event_id = event_id
        self.event = event = Event.mc_get(event_id)
        current_user_id = self.current_user_id

        if not event:
            return self.redirect('/')

        if event.state < EVENT_STATE_NOW:
            return self.redirect(event.link)

        state = event_joiner_state(
            event_id, current_user_id
        )

        if state < EVENT_JOIN_STATE_YES:
            return self.redirect(event.link)

        return event