'.run(function ($http) {', ' $http.defaults.headers.common["CSRF-Token"] = "{}";'.format( c.CSRF_TOKEN), '});' ]) @all_renderable() class Root: def index(self): raise HTTPRedirect('common/') static_views = StaticViews() angular = AngularJavascript() mount_site_sections(c.MODULE_ROOT) def error_page_404(status, message, traceback, version): return "Sorry, page not found!<br/><br/>{}<br/>{}".format(status, message) c.APPCONF['/']['error_page.404'] = error_page_404 cherrypy.tree.mount(Root(), c.PATH, c.APPCONF) static_overrides(os.path.join(c.MODULE_ROOT, 'static')) jsonrpc_services = {} def register_jsonrpc(service, name=None):
from os.path import join from uber.jinja import template_overrides from uber.utils import mount_site_sections, static_overrides from .config import config from . import models # noqa: F401 from . import model_checks # noqa: F401 from . import automated_emails # noqa: F401 static_overrides(join(config['module_root'], 'static')) template_overrides(join(config['module_root'], 'templates')) mount_site_sections(config['module_root'])
from residue import CoerceUTF8 as UnicodeText from sideboard.lib import parse_config from sqlalchemy.types import Boolean, Date from uber.config import c, Config from uber.decorators import cost_property, prereg_validation, presave_adjustment, validation from uber.menu import MenuItem from uber.models import Choice, DefaultColumn as Column, Session from uber.jinja import template_overrides from uber.utils import add_opt, mount_site_sections, static_overrides from magstock._version import __version__ # noqa: F401 config = parse_config(__file__) c.include_plugin_config(config) mount_site_sections(config['module_root']) static_overrides(join(config['module_root'], 'static')) template_overrides(join(config['module_root'], 'templates')) c.MENU.append_menu_item( MenuItem(name='MAGStock', submenu=[ MenuItem(name='Tent Groupings', href='../magstock/grouped'), MenuItem(name='Food Report', href='../magstock/food_consumers'), MenuItem(name='Campsite Assignments', href='../magstock/campsite_assignments'), MenuItem(name='Parking Info', href='../magstock/parking'), ]) ) @Config.mixin class ExtraConfig:
def season_pass(self, id): pss = self.query(PrevSeasonSupporter).filter_by(id=id).all() if pss: return pss[0] else: attendee = self.attendee(id) assert attendee.amount_extra >= c.SEASON_LEVEL return attendee def season_passes(self): attendees = {a.email: a for a in self.query(Attendee).filter(Attendee.amount_extra >= c.SEASON_LEVEL).all()} prev = [pss for pss in self.query(PrevSeasonSupporter).all() if pss.email not in attendees] return prev + list(attendees.values()) mount_site_sections(magprime_config['module_root']) if c.AT_THE_CON: from uber.site_sections.preregistration import Root @cherrypy.expose def form(self, *args, **kwargs): raise HTTPRedirect('../registration/register') Root.form = form # override badge CSV exports for magfest prime specific settings. # magfest prime no longer uses one-day badges, so remove it. _summary = uber.site_sections.summary.Root _summary.badge_zipfile_contents = \ [fn for fn in _summary.badge_zipfile_contents if fn.__name__ is not 'printed_badges_one_day']
For example, old laptops which have https://onsite.uber.magfest.org/uber/registration/register bookmarked as their homepage will automatically get redirected to https://onsite.uber.magfest.org/registration/register and so forth. """ path = cherrypy.request.path_info[len('/uber'):] if cherrypy.request.query_string: path += '?' + cherrypy.request.query_string raise HTTPRedirect(path) static_views = StaticViews() angular = AngularJavascript() mount_site_sections(c.MODULE_ROOT) def error_page_404(status, message, traceback, version): return "Sorry, page not found!<br/><br/>{}<br/>{}".format(status, message) c.APPCONF['/']['error_page.404'] = error_page_404 cherrypy.tree.mount(Root(), c.CHERRYPY_MOUNT_PATH, c.APPCONF) static_overrides(os.path.join(c.MODULE_ROOT, 'static')) def _make_jsonrpc_handler(services, debug=c.DEV_BOX, precall=lambda body: None): @cherrypy.expose