def create_app(): babel.init_app(app) BlueprintsManager.register(app) Migrate(app, db) app.config.from_object(environ.get('APP_CONFIG', 'config.ProductionConfig')) db.init_app(app) _manager = Manager(app) _manager.add_command('db', MigrateCommand) if app.config['CACHING']: cache.init_app(app, config={'CACHE_TYPE': 'simple'}) else: cache.init_app(app, config={'CACHE_TYPE': 'null'}) stripe.api_key = 'SomeStripeKey' app.secret_key = 'super secret key' app.json_encoder = MiniJSONEncoder app.config['BABEL_DEFAULT_LOCALE'] = 'en' app.config['JSONIFY_PRETTYPRINT_REGULAR'] = False app.config['FILE_SYSTEM_STORAGE_FILE_VIEW'] = 'static' app.logger.addHandler(logging.StreamHandler(sys.stdout)) app.logger.setLevel(logging.ERROR) app.jinja_env.add_extension('jinja2.ext.do') app.jinja_env.add_extension('jinja2.ext.loopcontrols') app.jinja_env.undefined = SilentUndefined app.jinja_env.filters['operation_name'] = operation_name # set up jwt app.config['JWT_AUTH_USERNAME_KEY'] = 'email' app.config['JWT_EXPIRATION_DELTA'] = timedelta(seconds=24 * 60 * 60) app.config['JWT_AUTH_URL_RULE'] = None _jwt = JWT(app, jwt_authenticate, jwt_identity) # setup celery app.config['CELERY_BROKER_URL'] = environ.get('REDIS_URL', 'redis://localhost:6379/0') app.config['CELERY_RESULT_BACKEND'] = app.config['CELERY_BROKER_URL'] HTMLMIN(app) CORS(app, resources={r"/api/*": {"origins": "*"}}) AuthManager.init_login(app) if app.config['TESTING'] and app.config['PROFILE']: # Profiling app.wsgi_app = ProfilerMiddleware(app.wsgi_app, restrictions=[30]) # API version 2 with app.app_context(): from app.api import api_v1 app.register_blueprint(api_v1) sa.orm.configure_mappers() return app, _manager, db, _jwt
def create_app(): babel.init_app(app) BlueprintsManager.register(app) Migrate(app, db) app.config.from_object(environ.get('APP_CONFIG', 'config.ProductionConfig')) db.init_app(app) _manager = Manager(app) _manager.add_command('db', MigrateCommand) if app.config['CACHING']: cache.init_app(app, config={'CACHE_TYPE': 'simple'}) else: cache.init_app(app, config={'CACHE_TYPE': 'null'}) stripe.api_key = 'SomeStripeKey' app.secret_key = 'super secret key' app.json_encoder = MiniJSONEncoder app.config['BABEL_DEFAULT_LOCALE'] = 'en' app.config['JSONIFY_PRETTYPRINT_REGULAR'] = False app.config['FILE_SYSTEM_STORAGE_FILE_VIEW'] = 'static' app.logger.addHandler(logging.StreamHandler(sys.stdout)) app.logger.setLevel(logging.ERROR) app.jinja_env.add_extension('jinja2.ext.do') app.jinja_env.add_extension('jinja2.ext.loopcontrols') app.jinja_env.undefined = SilentUndefined app.jinja_env.filters['operation_name'] = operation_name # set up jwt app.config['JWT_AUTH_USERNAME_KEY'] = 'email' app.config['JWT_EXPIRATION_DELTA'] = timedelta(seconds=24 * 60 * 60) app.config['JWT_AUTH_URL_RULE'] = None _jwt = JWT(app, jwt_authenticate, jwt_identity) # setup celery app.config['CELERY_BROKER_URL'] = environ.get('REDIS_URL', 'redis://localhost:6379/0') app.config['CELERY_RESULT_BACKEND'] = app.config['CELERY_BROKER_URL'] HTMLMIN(app) CORS(app, resources={r"/api/*": {"origins": "*"}}) AuthManager.init_login(app) if app.config['TESTING'] and app.config['PROFILE']: # Profiling app.wsgi_app = ProfilerMiddleware(app.wsgi_app, restrictions=[30]) # API version 2 with app.app_context(): from app.api import api_v1 app.register_blueprint(api_v1) sa.orm.configure_mappers() return app, _manager, db, _jwt
def check_accessible(panel_name): if not AuthManager.is_accessible(): return redirect(url_for('admin.login_view', next=request.url)) else: if not current_user.can_access_panel( panel_name) and not current_user.is_staff: abort(403)
def display_my_sessions_view(): placeholder_images = DataGetter.get_event_default_images() custom_placeholder = DataGetter.get_custom_placeholders() upcoming_events_sessions = DataGetter.get_sessions_of_user( upcoming_events=True) im_config = DataGetter.get_image_configs() im_size = '' for config in im_config: if config.page == 'mysession': im_size = config.size past_events_sessions = DataGetter.get_sessions_of_user( upcoming_events=False) page_content = { "tab_upcoming_events": "Upcoming Sessions", "tab_past_events": "Past Sessions", "title": "My Session Proposals" } if not AuthManager.is_verified_user(): flash( Markup( "Your account is unverified. " "Please verify by clicking on the confirmation link that has been emailed to you." '<br>Did not get the email? Please <a href="/resend_email/" class="alert-link"> ' 'click here to resend the confirmation.</a>')) return render_template('gentelella/users/mysessions/mysessions_list.html', upcoming_events_sessions=upcoming_events_sessions, past_events_sessions=past_events_sessions, page_content=page_content, placeholder_images=placeholder_images, custom_placeholder=custom_placeholder, im_size=im_size)
def display_my_sessions_view(): placeholder_images = DataGetter.get_event_default_images() custom_placeholder = DataGetter.get_custom_placeholders() upcoming_events_sessions = DataGetter.get_sessions_of_user(upcoming_events=True) im_config = DataGetter.get_image_configs() im_size = '' for config in im_config: if config.page == 'mysession': im_size = config.size past_events_sessions = DataGetter.get_sessions_of_user(upcoming_events=False) page_content = {"tab_upcoming_events": "Upcoming Sessions", "tab_past_events": "Past Sessions", "title": "My Session Proposals"} if not AuthManager.is_verified_user(): flash(Markup("Your account is unverified. " "Please verify by clicking on the confirmation link that has been emailed to you." '<br>Did not get the email? Please <a href="/resend_email/" class="alert-link"> ' 'click here to resend the confirmation.</a>')) return render_template('gentelella/users/mysessions/mysessions_list.html', upcoming_events_sessions=upcoming_events_sessions, past_events_sessions=past_events_sessions, page_content=page_content, placeholder_images=placeholder_images, custom_placeholder=custom_placeholder, im_size=im_size)
def index_view(): if not AuthManager.is_verified_user(): flash(Markup("Your account is unverified. " "Please verify by clicking on the confirmation link that has been emailed to you." '<br>Did not get the email? Please <a href="/resend_email/" class="alert-link"> ' 'click here to resend the confirmation.</a>')) profile = DataGetter.get_user(login.current_user.id) return render_template('gentelella/admin/profile/index.html', profile=profile)
def index_view(): if not AuthManager.is_verified_user(): flash(Markup("Your account is unverified. " "Please verify by clicking on the confirmation link that has been emailed to you." '<br>Did not get the email? Please <a href="/resend_email/" class="alert-link"> ' 'click here to resend the confirmation.</a>')) profile = DataGetter.get_user(login.current_user.id) return render_template('gentelella/admin/profile/index.html', profile=profile)
def display_export_view(event_id): event = DataGetter.get_event(event_id) export_jobs = DataGetter.get_export_jobs(event_id) user = current_user if not AuthManager.is_verified_user(): flash(Markup("Your account is unverified. " "Please verify by clicking on the confirmation link that has been emailed to you." '<br>Did not get the email? Please <a href="/resend_email/" class="alert-link"> ' 'click here to resend the confirmation.</a>')) return render_template( 'gentelella/users/events/export/export.html', event=event, export_jobs=export_jobs, current_user=user )
def display_export_view(event_id): event = DataGetter.get_event(event_id) export_jobs = DataGetter.get_export_jobs(event_id) user = current_user if not AuthManager.is_verified_user(): flash(Markup("Your account is unverified. " "Please verify by clicking on the confirmation link that has been emailed to you." '<br>Did not get the email? Please <a href="/resend_email/" class="alert-link"> ' 'click here to resend the confirmation.</a>')) return render_template( 'gentelella/users/events/export/export.html', event=event, export_jobs=export_jobs, current_user=user )
def index_view(): live_events = DataGetter.get_live_events_of_user() draft_events = DataGetter.get_draft_events_of_user() past_events = DataGetter.get_past_events_of_user() all_events = DataGetter.get_all_events() imported_events = DataGetter.get_imports_by_user() free_ticket_count = {} paid_ticket_count = {} donation_ticket_count = {} max_free_ticket = {} max_paid_ticket = {} max_donation_ticket = {} for event in all_events: free_ticket_count[ event.id] = TicketingManager.get_orders_count_by_type(event.id, type='free') max_free_ticket[event.id] = TicketingManager.get_max_orders_count( event.id, type='free') paid_ticket_count[ event.id] = TicketingManager.get_orders_count_by_type(event.id, type='paid') max_paid_ticket[event.id] = TicketingManager.get_max_orders_count( event.id, type='paid') donation_ticket_count[ event.id] = TicketingManager.get_orders_count_by_type( event.id, type='donation') max_donation_ticket[event.id] = TicketingManager.get_max_orders_count( event.id, type='donation') if not AuthManager.is_verified_user(): flash( Markup( 'Your account is unverified. ' 'Please verify by clicking on the confirmation link that has been emailed to you.' '<br>Did not get the email? Please <a href="/resend_email/" class="alert-link"> ' 'click here to resend the confirmation.</a>')) return render_template('gentelella/admin/event/index.html', live_events=live_events, draft_events=draft_events, past_events=past_events, all_events=all_events, free_ticket_count=free_ticket_count, paid_ticket_count=paid_ticket_count, donation_ticket_count=donation_ticket_count, max_free_ticket=max_free_ticket, max_paid_ticket=max_paid_ticket, max_donation_ticket=max_donation_ticket, imported_events=imported_events)
def index_view(): live_events = DataGetter.get_live_events_of_user() draft_events = DataGetter.get_draft_events_of_user() past_events = DataGetter.get_past_events_of_user() all_events = DataGetter.get_all_events_of_user() imported_events = DataGetter.get_imports_by_user() all_ticket_stats = {} for event in all_events: all_ticket_stats[event.id] = TicketingManager.get_ticket_stats(event) if not AuthManager.is_verified_user(): flash(Markup('Your account is unverified. ' 'Please verify by clicking on the confirmation link that has been emailed to you.' '<br>Did not get the email? Please <a href="/resend_email/" class="alert-link"> ' 'click here to resend the confirmation.</a>')) return render_template('gentelella/users/events/index.html', live_events=live_events, draft_events=draft_events, past_events=past_events, all_events=all_events, imported_events=imported_events, all_ticket_stats=all_ticket_stats)
def index_view(): live_events = DataGetter.get_live_events_of_user() draft_events = DataGetter.get_draft_events_of_user() past_events = DataGetter.get_past_events_of_user() all_events = DataGetter.get_all_events_of_user() imported_events = DataGetter.get_imports_by_user() all_ticket_stats = {} for event in all_events: all_ticket_stats[event.id] = TicketingManager.get_ticket_stats(event) if not AuthManager.is_verified_user(): flash(Markup('Your account is unverified. ' 'Please verify by clicking on the confirmation link that has been emailed to you.' '<br>Did not get the email? Please <a href="/resend_email/" class="alert-link"> ' 'click here to resend the confirmation.</a>')) return render_template('gentelella/admin/event/index.html', live_events=live_events, draft_events=draft_events, past_events=past_events, all_events=all_events, imported_events=imported_events, all_ticket_stats=all_ticket_stats)
def index_view(): live_events = DataGetter.get_live_events_of_user() draft_events = DataGetter.get_draft_events_of_user() past_events = DataGetter.get_past_events_of_user() all_events = DataGetter.get_all_events() imported_events = DataGetter.get_imports_by_user() free_ticket_count = {} paid_ticket_count = {} donation_ticket_count = {} max_free_ticket = {} max_paid_ticket = {} max_donation_ticket = {} for event in all_events: free_ticket_count[event.id] = TicketingManager.get_orders_count_by_type(event.id, type='free') max_free_ticket[event.id] = TicketingManager.get_max_orders_count(event.id, type='free') paid_ticket_count[event.id] = TicketingManager.get_orders_count_by_type(event.id, type='paid') max_paid_ticket[event.id] = TicketingManager.get_max_orders_count(event.id, type='paid') donation_ticket_count[event.id] = TicketingManager.get_orders_count_by_type(event.id, type='donation') max_donation_ticket[event.id] = TicketingManager.get_max_orders_count(event.id, type='donation') if not AuthManager.is_verified_user(): flash(Markup('Your account is unverified. ' 'Please verify by clicking on the confirmation link that has been emailed to you.' '<br>Did not get the email? Please <a href="/resend_email/" class="alert-link"> ' 'click here to resend the confirmation.</a>')) return render_template('gentelella/admin/event/index.html', live_events=live_events, draft_events=draft_events, past_events=past_events, all_events=all_events, free_ticket_count=free_ticket_count, paid_ticket_count=paid_ticket_count, donation_ticket_count=donation_ticket_count, max_free_ticket=max_free_ticket, max_paid_ticket=max_paid_ticket, max_donation_ticket=max_donation_ticket, imported_events=imported_events)
def check_accessible(panel_name): if not AuthManager.is_accessible(): return redirect(url_for('admin.login_view', next=request.url)) else: if not current_user.can_access_panel(panel_name) and not current_user.is_staff: abort(403)
def check_accessible(): if not AuthManager.is_accessible(): return redirect(url_for('admin.login_view', next=request.url))
def check_accessible(): if not AuthManager.is_accessible(): return redirect(url_for('admin.login_view', next=request.url))
def details_view(event_id): event = DataGetter.get_event(event_id) checklist = {"": ""} if fields_not_empty(event, ['name', 'start_time', 'end_time', 'location_name', 'organizer_name', 'organizer_description']): checklist["1"] = 'success' elif fields_not_empty(event, ['name', 'start_time', 'end_time']): checklist["1"] = 'missing_some' else: checklist["1"] = 'missing_main' call_for_speakers = DataGetter.get_call_for_papers(event_id).first() if call_for_speakers: if fields_not_empty(call_for_speakers, ['announcement', 'start_date', 'end_date']): checklist["4"] = "success" elif fields_not_empty(call_for_speakers, ['start_date', 'end_date']): checklist["4"] = "missing_some" else: checklist["4"] = 'missing_main' else: checklist["4"] = "optional" sponsors = DataGetter.get_sponsors(event_id).all() if not sponsors: checklist["2"] = 'optional' else: for sponsor in sponsors: if fields_not_empty(sponsor, ['name', 'description', 'url', 'level', 'logo']): checklist["2"] = 'success' break else: checklist["2"] = 'missing_some' if event.has_session_speakers: session_types = DataGetter.get_session_types_by_event_id(event_id) tracks = DataGetter.get_tracks(event_id) microlocations = DataGetter.get_microlocations(event_id) if not session_types and not tracks and not microlocations: checklist["3"] = 'optional' elif not session_types or not tracks or not microlocations: checklist["3"] = 'missing_main' else: for session_type in session_types: if fields_not_empty(session_type, ['name', 'length']): checklist["3"] = 'success' break else: checklist["3"] = 'missing_some' for microlocation in microlocations: if fields_not_empty(microlocation, ['name']): checklist["3"] = 'success' break else: checklist["3"] = 'missing_some' for tracks in tracks: if fields_not_empty(tracks, ['name', 'color']): checklist["3"] = 'success' break else: checklist["3"] = 'missing_some' checklist["5"] = 'success' else: checklist["3"] = 'optional' checklist["4"] = 'optional' checklist["5"] = 'optional' if not current_user.can_publish_event() and not AuthManager.is_verified_user(): flash(Markup('To make your event live, please verify your email by ' 'clicking on the confirmation link that has been emailed to you.<br>' 'Did not get the email? Please <a href="/resend_email/" class="alert-link"> click here to ' 'resend the confirmation.</a>')) sessions = {'pending': get_count(DataGetter.get_sessions_by_state_and_event_id('pending', event_id)), 'accepted': get_count(DataGetter.get_sessions_by_state_and_event_id('accepted', event_id)), 'rejected': get_count(DataGetter.get_sessions_by_state_and_event_id('rejected', event_id)), 'draft': get_count(DataGetter.get_sessions_by_state_and_event_id('draft', event_id))} return render_template('gentelella/users/events/details/details.html', event=event, checklist=checklist, sessions=sessions, settings=get_settings())
def details_view(event_id): event = DataGetter.get_event(event_id) orders = TicketingManager.get_orders(event_id) checklist = {"": ""} if fields_not_empty(event, [ 'name', 'start_time', 'end_time', 'location_name', 'organizer_name', 'organizer_description' ]): checklist["1"] = 'success' elif fields_not_empty(event, ['name', 'start_time', 'end_time']): checklist["1"] = 'missing_some' else: checklist["1"] = 'missing_main' call_for_speakers = DataGetter.get_call_for_papers(event_id).first() if call_for_speakers: if fields_not_empty(call_for_speakers, ['announcement', 'start_date', 'end_date']): checklist["4"] = "success" elif fields_not_empty(call_for_speakers, ['start_date', 'end_date']): checklist["4"] = "missing_some" else: checklist["4"] = 'missing_main' else: checklist["4"] = "optional" sponsors = DataGetter.get_sponsors(event_id).all() if not sponsors: checklist["2"] = 'optional' else: for sponsor in sponsors: if fields_not_empty( sponsor, ['name', 'description', 'url', 'level', 'logo']): checklist["2"] = 'success' break else: checklist["2"] = 'missing_some' if event.has_session_speakers: session_types = DataGetter.get_session_types_by_event_id(event_id) tracks = DataGetter.get_tracks(event_id) microlocations = DataGetter.get_microlocations(event_id) if not session_types and not tracks and not microlocations: checklist["3"] = 'optional' elif not session_types or not tracks or not microlocations: checklist["3"] = 'missing_main' else: for session_type in session_types: if fields_not_empty(session_type, ['name', 'length']): checklist["3"] = 'success' break else: checklist["3"] = 'missing_some' for microlocation in microlocations: if fields_not_empty(microlocation, ['name']): checklist["3"] = 'success' break else: checklist["3"] = 'missing_some' for tracks in tracks: if fields_not_empty(tracks, ['name', 'color']): checklist["3"] = 'success' break else: checklist["3"] = 'missing_some' checklist["5"] = 'success' else: checklist["3"] = 'optional' checklist["4"] = 'optional' checklist["5"] = 'optional' if not current_user.can_publish_event( ) and not AuthManager.is_verified_user(): flash( Markup( 'To make your event live, please verify your email by ' 'clicking on the confirmation link that has been emailed to you.<br>' 'Did not get the email? Please <a href="/resend_email/" class="alert-link"> click here to ' 'resend the confirmation.</a>')) sessions = { 'pending': get_count( DataGetter.get_sessions_by_state_and_event_id('pending', event_id)), 'accepted': get_count( DataGetter.get_sessions_by_state_and_event_id( 'accepted', event_id)), 'rejected': get_count( DataGetter.get_sessions_by_state_and_event_id( 'rejected', event_id)), 'draft': get_count( DataGetter.get_sessions_by_state_and_event_id('draft', event_id)) } tickets_summary = {} for ticket in event.tickets: tickets_summary[str(ticket.id)] = { 'name': ticket.name, 'quantity': ticket.quantity, 'completed': { 'tickets_count': 0, 'sales': 0 }, 'placed': { 'tickets_count': 0, 'sales': 0 }, 'pending': { 'tickets_count': 0, 'sales': 0 }, 'expired': { 'class': 'danger', 'tickets_count': 0, 'sales': 0 }, 'deleted': { 'tickets_count': 0, 'sales': 0 }, 'cancelled': { 'tickets_count': 0, 'sales': 0 }, } orders_summary = { 'completed': { 'tickets_count': 0, 'orders_count': 0, 'total_sales': 0 }, 'placed': { 'tickets_count': 0, 'orders_count': 0, 'total_sales': 0 }, 'pending': { 'tickets_count': 0, 'orders_count': 0, 'total_sales': 0 }, 'expired': { 'tickets_count': 0, 'orders_count': 0, 'total_sales': 0 }, 'deleted': { 'tickets_count': 0, 'orders_count': 0, 'total_sales': 0 }, 'cancelled': { 'tickets_count': 0, 'orders_count': 0, 'total_sales': 0 } } for order in orders: if order.status == 'initialized': order.status = 'pending' fees = DataGetter.get_fee_settings_by_currency( DataGetter.get_event(order.event_id).payment_currency) orders_summary[str(order.status)]['orders_count'] += 1 orders_summary[str(order.status)]['total_sales'] += order.amount for order_ticket in order.tickets: discount = TicketingManager.get_discount_code( event_id, order.discount_code_id) orders_summary[str( order.status)]['tickets_count'] += order_ticket.quantity ticket = get_ticket(order_ticket.ticket_id) tickets_summary[str(ticket.id)][str( order.status)]['tickets_count'] += order_ticket.quantity ticket_price = ticket.price if fees and not ticket.absorb_fees: order_fee = fees.service_fee * (ticket.price * order_ticket.quantity) / 100.0 if order_fee > fees.maximum_fee: ticket_price = ticket.price + fees.maximum_fee / order_ticket.quantity else: ticket_price = ticket.price + fees.service_fee * ticket.price / 100.0 if order.paid_via != 'free' and order.amount > 0: if discount and str(ticket.id) in discount.tickets.split(","): if discount.type == "amount": tickets_summary[str(ticket.id)][str( order.status )]['sales'] += order_ticket.quantity * (ticket_price - discount.value) else: tickets_summary[str(ticket.id)][str( order.status )]['sales'] += order_ticket.quantity * ( ticket_price - discount.value * ticket_price / 100.0) else: tickets_summary[str(ticket.id)][str( order.status )]['sales'] += order_ticket.quantity * ticket_price return render_template('gentelella/users/events/details/details.html', event=event, checklist=checklist, sessions=sessions, tickets_summary=tickets_summary, orders_summary=orders_summary, settings=get_settings())
def details_view(event_id): event = DataGetter.get_event(event_id) checklist = {"": ""} if fields_not_empty(event, ['name', 'start_time', 'end_time', 'location_name', 'organizer_name', 'organizer_description']): checklist["1"] = 'success' elif fields_not_empty(event, ['name', 'start_time', 'end_time']): checklist["1"] = 'missing_some' else: checklist["1"] = 'missing_main' call_for_speakers = DataGetter.get_call_for_papers(event_id).first() if call_for_speakers: if fields_not_empty(call_for_speakers, ['announcement', 'start_date', 'end_date']): checklist["4"] = "success" elif fields_not_empty(call_for_speakers, ['start_date', 'end_date']): checklist["4"] = "missing_some" else: checklist["4"] = 'missing_main' else: checklist["4"] = "optional" sponsors = DataGetter.get_sponsors(event_id).all() if not sponsors: checklist["2"] = 'optional' else: for sponsor in sponsors: if fields_not_empty(sponsor, ['name', 'description', 'url', 'level', 'logo']): checklist["2"] = 'success' break else: checklist["2"] = 'missing_some' if event.has_session_speakers: session_types = DataGetter.get_session_types_by_event_id(event_id) tracks = DataGetter.get_tracks(event_id) microlocations = DataGetter.get_microlocations(event_id) if not session_types and not tracks and not microlocations: checklist["3"] = 'optional' elif not session_types or not tracks or not microlocations: checklist["3"] = 'missing_main' else: for session_type in session_types: if fields_not_empty(session_type, ['name', 'length']): checklist["3"] = 'success' break else: checklist["3"] = 'missing_some' for microlocation in microlocations: if fields_not_empty(microlocation, ['name']): checklist["3"] = 'success' break else: checklist["3"] = 'missing_some' for tracks in tracks: if fields_not_empty(tracks, ['name', 'color']): checklist["3"] = 'success' break else: checklist["3"] = 'missing_some' checklist["5"] = 'success' else: checklist["3"] = 'optional' checklist["4"] = 'optional' checklist["5"] = 'optional' if not current_user.can_publish_event() and not AuthManager.is_verified_user(): flash(Markup('To make your event live, please verify your email by ' 'clicking on the confirmation link that has been emailed to you.<br>' 'Did not get the email? Please <a href="/resend_email/" class="alert-link"> click here to ' 'resend the confirmation.</a>')) sessions = {'pending': get_count(DataGetter.get_sessions_by_state_and_event_id('pending', event_id)), 'accepted': get_count(DataGetter.get_sessions_by_state_and_event_id('accepted', event_id)), 'rejected': get_count(DataGetter.get_sessions_by_state_and_event_id('rejected', event_id)), 'draft': get_count(DataGetter.get_sessions_by_state_and_event_id('draft', event_id))} return render_template('gentelella/admin/event/details/details.html', event=event, checklist=checklist, sessions=sessions, settings=get_settings())