def get(self, id): event = Event.get_by_id(int(id)) user = users.get_current_user() if user: is_admin = username(user) in dojo('/groups/events') is_staff = username(user) in dojo('/groups/staff') can_approve = (event.status in ['pending'] and is_admin) can_staff = (event.status in ['pending', 'understaffed', 'approved'] and is_staff and not user in event.staff) logout_url = users.create_logout_url('/') else: login_url = users.create_login_url('/') self.response.out.write(template.render('templates/event.html', locals()))
def post(self, id): event = Event.get_by_id(int(id)) user = users.get_current_user() is_admin = username(user) in dojo('/groups/events') is_staff = username(user) in dojo('/groups/staff') state = self.request.get('state') if state: if state.lower() == 'approve' and is_admin: event.approve() if state.lower() == 'staff' and is_staff: event.add_staff(user) if state.lower() == 'cancel' and is_admin: event.cancel() if state.lower() == 'expire' and is_admin: event.expire() if event.status == 'approved': notify_owner_approved(event) self.redirect('/event/%s-%s' % (event.key().id(), slugify(event.name)))
def get(self): user = users.get_current_user() if user: logout_url = users.create_logout_url('/') else: login_url = users.create_login_url('/') today = datetime.today() events = Event.all().filter('start_time < ', today).order('-start_time') is_admin = username(user) in dojo('/groups/events') self.response.out.write(template.render('templates/past.html', locals()))
def get(self): user = users.get_current_user() if user: logout_url = users.create_logout_url('/') else: login_url = users.create_login_url('/') events = Event.all().filter('member = ', user).order('start_time') today = datetime.today() tomorrow = today + timedelta(days=1) is_admin = username(user) in dojo('/groups/events') self.response.out.write(template.render('templates/myevents.html', locals()))
def get(self): user = users.get_current_user() if user: logout_url = users.create_logout_url('/') else: login_url = users.create_login_url('/') events = Event.get_pending_list() today = datetime.today() tomorrow = today + timedelta(days=1) is_admin = username(user) in dojo('/groups/events') self.response.out.write(template.render('templates/pending.html', locals()))
def post(self): noop = dojo('/groups/events',force=True)
def get(self): noop = dojo('/groups/events',force=True)
def get(self): noop = dojo("/groups/events", force=True)