def create_event_sub_topics(): event_sub_topic = { "Film, Media & Entertainment": ["Comedy", "Gaming", "Anime"], "Community & Culture": ["City/Town", "Other", "LGBT"], "Home & Lifestyle": ["Dating", "Home & Garden"], "Sports & Fitness": ["Volleyball", "Other"], "Health & Wellness": ["Yoga", "Medical"], "Food & Drink": ["Other", "Food", "Beer"], "Other": ["Avatar", "Logo"], "Science & Technology": ["Robotics", "Other", "High Tech", "Science", "Social Media", "Medicine", "Mobile", "Biotech"], "Music": ["Cultural", "Pop", "Top 40", "EDM / Electronic", "R&B", "Other", "Classical"], "Performing & Visual Arts": ["Craft", "Comedy", "Fine Art", "Orchestra"], "Family & Education": ["Education", "Baby", "Reunion"], "Business & Professional": ["Career", "Startups & Small Business", "Educators", "Design", "Finance"], "Charity & Causes": ["Education", "Other", "Environment"], "Hobbies & Special Interest": ["Other", "Anime/Comics"], "Seasonal & Holiday": ["Easter", "Other"], "Auto, Boat & Air": ["Auto", "Air"], "Religion & Spirituality": ["Mysticism and Occult"], "Government & Politics": ["Non-partisan"] } eventopics=db.session.query(EventTopic).all() for keysub_topic in event_sub_topic: for subtopic in event_sub_topic[keysub_topic]: get_or_create(EventSubTopic, name=subtopic, event_topic_id=next(x for x in eventopics if x.name==keysub_topic).id)
def create_panel_permissions(): sales_admin = CustomSysRole.query.filter_by(name='Sales Admin').first() perm, _ = get_or_create(PanelPermission, panel_name=SALES, role=sales_admin) db.session.add(perm) marketer = CustomSysRole.query.filter_by(name='Marketer').first() perm, _ = get_or_create(PanelPermission, panel_name=SALES, role=marketer) db.session.add(perm)
def create_event_image_sizes(): get_or_create( ImageSizes, type='event-image', full_width=1300, full_height=500, full_aspect=True, full_quality=80, icon_width=75, icon_height=30, icon_aspect=True, icon_quality=80, thumbnail_width=500, thumbnail_height=200, thumbnail_aspect=True, thumbnail_quality=80, logo_width=500, logo_height=200 )
def test_get_or_create(self): with app.test_request_context(): event = EventFactoryBasic() save_to_db(event) obj, is_created = get_or_create(Event, name=event.name) self.assertEqual(event.id, obj.id) self.assertFalse(is_created) obj, is_created = get_or_create(Event, name="new event", starts_at=event.starts_at, ends_at=event.ends_at) self.assertNotEqual(event.id, obj.id) self.assertTrue(is_created)
def create_user_permissions(): # Publish Event user_perm, _ = get_or_create(UserPermission, name='publish_event', description='Publish event (make event live)') user_perm.verified_user = True db.session.add(user_perm) # Create Event user_perm, _ = get_or_create(UserPermission, name='create_event', description='Create event') user_perm.verified_user, user_perm.unverified_user = True, False db.session.add(user_perm)
def create_event_types(): event_type = ['Camp, Treat & Retreat', 'Dinner or Gala', 'Other', 'Concert or Performance', 'Conference', 'Seminar or Talk', 'Convention', 'Festival or Fair', 'Tour', 'Screening', 'Game or Competition', 'Party or Social Gathering', 'Race or Endurance Event', 'Meeting or Networking Event', 'Attraction', 'Class, Training, or Workshop', 'Appearance or Signing', 'Tournament', 'Rally'] for type_ in event_type: get_or_create(EventType, name=type_)
def create_services(): track = Track.get_service_name() session = Session.get_service_name() speaker = Speaker.get_service_name() sponsor = Sponsor.get_service_name() microlocation = Microlocation.get_service_name() get_or_create(Service, name=track) get_or_create(Service, name=session) get_or_create(Service, name=speaker) get_or_create(Service, name=sponsor) get_or_create(Service, name=microlocation)
def create_event_topics(): event_topic = ['Health & Wellness', 'Home & Lifestyle', 'Charity & Causes', 'Other', 'Religion & Spirituality', 'Community & Culture', 'Government & Politics', 'Government & Politics', 'Auto, Boat & Air', 'Travel & Outdoor', 'Hobbies & Special Interest', 'Sports & Fitness', 'Business & Professional', 'Music', 'Seasonal & Holiday', 'Film, Media & Entertainment', 'Family & Education', 'Science & Technology', 'Performing & Visual Arts', 'Food & Drink', 'Family & Education'] for topic in event_topic: get_or_create(EventTopic, name=topic)
def create_permissions(): orgr = Role.query.get(1) coorgr = Role.query.get(2) track_orgr = Role.query.get(3) mod = Role.query.get(4) attend = Role.query.get(5) regist = Role.query.get(6) track = Service.query.get(1) session = Service.query.get(2) speaker = Service.query.get(3) sponsor = Service.query.get(4) microlocation = Service.query.get(5) # For ORGANIZER # All four permissions set to True services = [track, session, speaker, sponsor, microlocation] roles = [attend, regist] for service in services: perm, _ = get_or_create(Permission, role=orgr, service=service) db.session.add(perm) # For COORGANIZER for service in services: perm, _ = get_or_create(Permission, role=coorgr, service=service) perm.can_create, perm.can_delete = False, False db.session.add(perm) # For TRACK_ORGANIZER for service in services: perm, _ = get_or_create(Permission, role=track_orgr, service=service) if not service == track: perm.can_create, perm.can_update, perm.can_delete = False, False, False db.session.add(perm) # For MODERATOR for service in services: perm, _ = get_or_create(Permission, role=mod, service=service) perm.can_create, perm.can_update, perm.can_delete = False, False, False db.session.add(perm) # For ATTENDEE and REGISTRAR services = [track, session, speaker, sponsor, microlocation] roles = [attend, regist] for role in roles: for service in services: perm, _ = get_or_create(Permission, role=role, service=service) perm.can_create, perm.can_update, perm.can_delete = False, False, False db.session.add(perm)
def test_is_registrar(self): """Method to test whether a user is registrar of an event or not""" with app.test_request_context(headers=self.auth, method="POST"): uer, is_created = get_or_create(UsersEventsRoles, user_id=1, event_id=1) uer.role_id = 6 save_to_db(uer) self.assertTrue(has_access('is_registrar', event_id=1))
def create_admin_message_settings(): default_mails = ["Next Event", "Session Schedule Change", "User email", "Invitation For Papers", "After Event", "Ticket(s) Purchased", "Session Accept or Reject", "Event Published", "Event Export Failed", "Event Exported", "Event Role Invitation", "New Session Proposal"] for mail in MAILS: if mail in default_mails: get_or_create(MessageSettings, action=mail, mail_status=1, notification_status=1, user_control_status=1) else: get_or_create(MessageSettings, action=mail, mail_status=0, notification_status=0, user_control_status=0)
def check_or_create_bot(self): bot_email = '*****@*****.**' bot_user, _ = get_or_create( User, _email=bot_email, defaults=dict(password=generate_pass(), first_name='open-event-bot'), ) return bot_user
def get_room_session_stream(db, user=None, **kwargs): stream = VideoStreamFactoryBase(**kwargs) room = MicrolocationSubVideoStreamFactory(video_stream=stream) session = SessionSubFactory(microlocation=room, event=room.event) if user: role, _ = get_or_create(Role, name='owner', title_name='Owner') UsersEventsRoles(user=user, event=room.event, role=role) db.session.commit() return room, stream, session
def create_event_image_sizes(): get_or_create( ImageSizes, type='event-image', full_width=1300, full_height=500, full_aspect=True, full_quality=80, icon_width=75, icon_height=30, icon_aspect=True, icon_quality=80, thumbnail_width=500, thumbnail_height=200, thumbnail_aspect=True, thumbnail_quality=80, logo_width=500, logo_height=200, )
def create_admin_message_settings(): default_mails = [ "Next Event", "Session Schedule Change", "User email", "Invitation For Papers", "After Event", "Ticket(s) Purchased", "Session Accept or Reject", "Event Published", "Event Export Failed", "Event Exported", "Event Role Invitation", "New Session Proposal" ] for mail in MAILS: if mail in default_mails: get_or_create(MessageSettings, action=mail, mail_status=True, notification_status=True, user_control_status=True) else: get_or_create(MessageSettings, action=mail, mail_status=False, notification_status=False, user_control_status=False)
def before_get(self, args, kwargs): if kwargs.get('video_stream_id'): stream = safe_query_kwargs(VideoStream, kwargs, 'video_stream_id', 'id') if stream.channel and stream.channel.provider == 'bbb': if not has_access('is_organizer', event_id=stream.event_id): raise ForbiddenError( {'pointer': 'event_id'}, 'You need to be the event organizer to access video recordings.', ) if stream.extra is not None: params = dict( meetingID=stream.extra['response']['meetingID'], ) channel = stream.channel bbb = BigBlueButton(channel.api_url, channel.api_key) result = bbb.request('getRecordings', params) if result.data['response']['recordings']: recordings = [] if (type(result.data['response']['recordings'] ['recording']) is list): recordings = result.data['response']['recordings'][ 'recording'] else: recordings.append(result.data['response'] ['recordings']['recording']) for recording in recordings: get_or_create( VideoRecording, bbb_record_id=recording['recordID'], participants=recording['participants'], url=recording['playback']['format']['url'], start_time=datetime.fromtimestamp( int(int(recording['startTime']) / 1000)), end_time=datetime.fromtimestamp( int(int(recording['endTime']) / 1000)), video_stream=stream, )
def test_notify_event_role(db): invite = RoleInviteSubFactory() role, _ = get_or_create(Role, name='owner', title_name='Owner') UsersEventsRoles(user=UserFactory(), event=invite.event, role=role) user = UserFactory() db.session.commit() notify_event_role_invitation(invite, user, invite.event.owner) notification = Notification.query.first() assert notification.user == user assert notification.content.type == NotificationType.EVENT_ROLE assert notification.content.target == invite assert notification.content.actors[0].actor == invite.event.owner
def create_event_sub_topics(): event_sub_topic = { "Film, Media & Entertainment": ["Comedy", "Gaming", "Anime"], "Community & Culture": ["City/Town", "Other", "LGBT"], "Home & Lifestyle": ["Dating", "Home & Garden"], "Sports & Fitness": ["Volleyball", "Other"], "Health & Wellness": ["Yoga", "Medical"], "Food & Drink": ["Other", "Food", "Beer"], "Other": ["Avatar", "Logo"], "Science & Technology": [ "Robotics", "Other", "High Tech", "Science", "Social Media", "Medicine", "Mobile", "Biotech" ], "Music": [ "Cultural", "Pop", "Top 40", "EDM / Electronic", "R&B", "Other", "Classical" ], "Performing & Visual Arts": ["Craft", "Comedy", "Fine Art", "Orchestra"], "Family & Education": ["Education", "Baby", "Reunion"], "Business & Professional": [ "Career", "Startups & Small Business", "Educators", "Design", "Finance" ], "Charity & Causes": ["Education", "Other", "Environment"], "Hobbies & Special Interest": ["Other", "Anime/Comics"], "Seasonal & Holiday": ["Easter", "Other"], "Auto, Boat & Air": ["Auto", "Air"], "Religion & Spirituality": ["Mysticism and Occult"], "Government & Politics": ["Non-partisan"] } eventopics = db.session.query(EventTopic).all() for keysub_topic in event_sub_topic: for subtopic in event_sub_topic[keysub_topic]: get_or_create(EventSubTopic, name=subtopic, event_topic_id=next(x for x in eventopics if x.name == keysub_topic).id)
def get_stream(db, user=None, with_event=False, **kwargs): stream = VideoStreamFactoryBase(**kwargs) if with_event: event = EventFactoryBasic() stream.event = event else: room = MicrolocationSubVideoStreamFactory(video_stream=stream) event = room.event if user: role, _ = get_or_create(Role, name='owner', title_name='Owner') UsersEventsRoles(user=user, event=event, role=role) db.session.commit() return stream
def create_settings(): get_or_create(Setting, app_name='Open Event') if current_app.config['DEVELOPMENT']: # get the stripe keys from the env file and save it in the settings. env.read_envfile() stripe_secret_key = env('STRIPE_SECRET_KEY', default=None) stripe_publishable_key = env('STRIPE_PUBLISHABLE_KEY', default=None) stripe_client_id = env('STRIPE_CLIENT_ID', default=None) paypal_sandbox_client = env('PAYPAL_SANDBOX_CLIENT', default=None) paypal_sandbox_secret = env('PAYPAL_SANDBOX_SECRET', default=None) fb_client_id = env('FACEBOOK_CLIENT_ID', default=None) fb_client_secret = env('FACEBOOK_CLIENT_SECRET', default=None) google_client_id = env('GOOGLE_CLIENT_ID', default=None) google_client_secret = env('GOOGLE_CLIENT_SECRET', default=None) tw_consumer_key = env('TWITTER_CONSUMER_KEY', default=None) tw_consumer_secret = env('TWITTER_CONSUMER_SECRET', default=None) in_client_id = env('INSTAGRAM_CLIENT_ID', default=None) in_client_secret = env('INSTAGRAM_CLIENT_SECRET', default=None) setting, _ = get_or_create(Setting, app_name='Open Event') setting.stripe_client_id = stripe_client_id setting.stripe_publishable_key = stripe_publishable_key setting.stripe_secret_key = stripe_secret_key setting.paypal_sandbox_client = paypal_sandbox_client setting.paypal_sandbox_secret = paypal_sandbox_secret setting.fb_client_id = fb_client_id setting.fb_client_secret = fb_client_secret setting.google_client_id = google_client_id setting.google_client_secret = google_client_secret setting.tw_consumer_key = tw_consumer_key setting.tw_consumer_secret = tw_consumer_secret setting.in_client_id = in_client_id setting.in_client_secret = in_client_secret db.session.add(setting) db.session.commit()
def get_session(db, user, event_owner=False, **kwargs): new_user = UserFactory(is_admin=False, is_verified=False) if event_owner: owner = user creator = new_user else: owner = new_user creator = user session = SessionSubFactory(creator_id=creator.id, **kwargs) role, _ = get_or_create(Role, name='owner', title_name='Owner') UsersEventsRoles(user=owner, event=session.event, role=role) db.session.commit() return session
def create_event_types(): event_type = [ 'Camp, Treat & Retreat', 'Dinner or Gala', 'Other', 'Concert or Performance', 'Conference', 'Seminar or Talk', 'Convention', 'Festival or Fair', 'Tour', 'Screening', 'Game or Competition', 'Party or Social Gathering', 'Race or Endurance Event', 'Meeting or Networking Event', 'Attraction', 'Class, Training, or Workshop', 'Appearance or Signing', 'Tournament', 'Rally', ] for type_ in event_type: get_or_create(EventType, name=type_)
def create_panels(): panels = [ SALES, ADMIN, EVENTS, SESSIONS, USERS, PERMISSIONS, MESSAGES, REPORTS, SETTINGS, CONTENT, ] for panel in panels: perm, _ = get_or_create(PanelPermission, panel_name=panel) db.session.add(perm)
def get_event(db, user=None): event = EventFactoryBasic(state='published') if user: role, _ = get_or_create(Role, name='owner', title_name='Owner') UsersEventsRoles(user=user, event=event, role=role) CustomForms( event=event, form='speaker', field_identifier='email', type='text', is_included=True, is_required=True, ) db.session.commit() return event
def create_permissions(): orgr = Role.query.get(1) coorgr = Role.query.get(2) track_orgr = Role.query.get(3) mod = Role.query.get(4) attend = Role.query.get(5) regist = Role.query.get(6) ownr = Role.query.get(7) track = Service.query.get(1) session = Service.query.get(2) speaker = Service.query.get(3) sponsor = Service.query.get(4) microlocation = Service.query.get(5) # For ORGANIZER and OWNER # All four permissions set to True services = [track, session, speaker, sponsor, microlocation] roles = [attend, regist] for service in services: perm, _ = get_or_create(Permission, role=ownr, service=service) db.session.add(perm) for service in services: perm, _ = get_or_create(Permission, role=orgr, service=service) db.session.add(perm) # For COORGANIZER for service in services: perm, _ = get_or_create(Permission, role=coorgr, service=service) perm.can_create, perm.can_delete = False, False db.session.add(perm) # For TRACK_ORGANIZER for service in services: perm, _ = get_or_create(Permission, role=track_orgr, service=service) if not service == track: perm.can_create, perm.can_update, perm.can_delete = False, False, False db.session.add(perm) # For MODERATOR for service in services: perm, _ = get_or_create(Permission, role=mod, service=service) perm.can_create, perm.can_update, perm.can_delete = False, False, False db.session.add(perm) # For ATTENDEE and REGISTRAR services = [track, session, speaker, sponsor, microlocation] roles = [attend, regist] for role in roles: for service in services: perm, _ = get_or_create(Permission, role=role, service=service) perm.can_create, perm.can_update, perm.can_delete = False, False, False db.session.add(perm)
def test_send_monthly_invoice(db): """Method to test monthly invoices""" TicketFeesFactory(service_fee=10.23, maximum_fee=11, country='global') test_order = OrderSubFactory( status='completed', event__state='published', completed_at=monthdelta(this_month_date(), -1), amount=100, ) role, _ = get_or_create(Role, name='owner', title_name='Owner') UsersEventsRoles(user=UserFactory(), event=test_order.event, role=role) AttendeeSubFactory(event=test_order.event, order=test_order) db.session.commit() send_monthly_event_invoice() event_invoice = test_order.event.invoices[0] assert event_invoice.amount == 10.23
def create_permissions(): ownr = Role.query.filter_by(name=Role.OWNER).first() orgr = Role.query.filter_by(name=Role.ORGANIZER).first() coorgr = Role.query.filter_by(name=Role.COORGANIZER).first() track_orgr = Role.query.filter_by(name=TRACK_ORGANIZER).first() mod = Role.query.filter_by(name=MODERATOR).first() regist = Role.query.filter_by(name=REGISTRAR).first() track = Service.query.filter_by(name=Track.get_service_name()).first() session = Service.query.filter_by(name=Session.get_service_name()).first() speaker = Service.query.filter_by(name=Speaker.get_service_name()).first() sponsor = Service.query.filter_by(name=Sponsor.get_service_name()).first() microlocation = Service.query.filter_by( name=Microlocation.get_service_name()).first() # For ORGANIZER and OWNER # All four permissions set to True services = [track, session, speaker, sponsor, microlocation] for service in services: perm, _ = get_or_create(Permission, role=ownr, service=service) db.session.add(perm) for service in services: perm, _ = get_or_create(Permission, role=orgr, service=service) db.session.add(perm) # For COORGANIZER for service in services: perm, _ = get_or_create(Permission, role=coorgr, service=service) perm.can_create, perm.can_delete = False, False db.session.add(perm) # For TRACK_ORGANIZER for service in services: perm, _ = get_or_create(Permission, role=track_orgr, service=service) if not service == track: perm.can_create, perm.can_update, perm.can_delete = False, False, False db.session.add(perm) # For MODERATOR for service in services: perm, _ = get_or_create(Permission, role=mod, service=service) perm.can_create, perm.can_update, perm.can_delete = False, False, False db.session.add(perm) # For REGISTRAR services = [track, session, speaker, sponsor, microlocation] for service in services: perm, _ = get_or_create(Permission, role=regist, service=service) perm.can_create, perm.can_update, perm.can_delete = False, False, False db.session.add(perm)
def test_group_role_access(app, db, user, jwt): event = EventFactoryBasic() with app.test_request_context(headers=jwt): assert has_access('is_coorganizer', event_id=event.id) == False group = GroupSubFactory(user=user) role, _ = get_or_create(Role, name='organizer', title_name='Organizer') ugr = UsersGroupsRoles( email=user.email, user=user, group=group, role=role, accepted=True, role_id=role.id, ) event.group_id = group.id db.session.commit() with app.test_request_context(headers=jwt): assert has_access('is_coorganizer', event_id=event.id) == True
def test_create_order_override_amount_organizer(client, db, user, jwt): event = EventFactoryBasic() tickets = _create_tickets([10, 20], event=event, quantity=2) role, _ = get_or_create(Role, name='owner', title_name='Owner') UsersEventsRoles(user=user, event=event, role=role) db.session.commit() response = client.post( '/v1/orders/create-order', content_type='application/json', headers=jwt, data=json.dumps({ 'amount': 0, 'tickets': _create_ticket_dict(tickets, [1, 2]) }), ) assert response.status_code == 200 order_dict = json.loads(response.data) order = Order.query.get(order_dict['data']['id']) assert order_dict['data']['attributes']['amount'] == 0 assert order.amount == 0
def test_group_role_invite(db, client, user, jwt): group = GroupSubFactory(user=user) role, _ = get_or_create(Role, name='organizer', title_name='Organizer') db.session.commit() data = json.dumps({ 'data': { 'type': 'users-groups-role', "attributes": { "email": "*****@*****.**" }, "relationships": { "group": { "data": { "id": str(group.id), "type": "group" } }, "role": { "data": { "id": str(role.id), "type": "role" } }, }, } }) response = client.post( '/v1/users-groups-roles', content_type='application/vnd.api+json', headers=jwt, data=data, ) assert response.status_code == 201
def test_group_patch_access_allow(db, client, user, jwt): event = EventFactoryBasic() role, _ = get_or_create(Role, name='owner', title_name='Owner') UsersEventsRoles(user=user, event=event, role=role) db.session.commit() group = GroupFactory(user_id=user.id) db.session.commit() data = json.dumps({ "data": { "type": "group", "id": str(group.id), "relationships": { "events": { "data": [{ "id": str(event.id), "type": "event" }] }, }, "attributes": { "name": "eventgp1" }, } }) response = client.patch( f'/v1/groups/{group.id}', content_type='application/vnd.api+json', headers=jwt, data=data, ) assert json.loads(response.data)['data']['id'] == str(group.id)
def create_panel_permissions(): sales_panel, _ = get_or_create(PanelPermission, panel_name=SALES) sales_admin, _ = get_or_create(CustomSysRole, name='Sales Admin') marketer, _ = get_or_create(CustomSysRole, name='Marketer') sales_panel.custom_system_roles.append(sales_admin) sales_panel.custom_system_roles.append(marketer)
def create_custom_sys_roles(): role, _ = get_or_create(CustomSysRole, name='Sales Admin') db.session.add(role) role, _ = get_or_create(CustomSysRole, name='Marketer') db.session.add(role)
def create_modules(): get_or_create(Module, donation_include=False)
def create_event_locations(): event_location = ['India', 'Singapore', 'Berlin', 'New York', 'Hong Kong'] for loc_ in event_location: get_or_create(EventLocation, name=loc_)
def create_settings(): get_or_create(Setting, app_name='Events City')
def create_permissions(): orgr = Role.query.get(1) coorgr = Role.query.get(2) track_orgr = Role.query.get(3) mod = Role.query.get(4) track = Service.query.get(1) session = Service.query.get(2) speaker = Service.query.get(3) sponsor = Service.query.get(4) microlocation = Service.query.get(5) # For ORGANIZER # All four permissions set to True get_or_create(Permission, role=orgr, service=track) get_or_create(Permission, role=orgr, service=session) get_or_create(Permission, role=orgr, service=speaker) get_or_create(Permission, role=orgr, service=sponsor) get_or_create(Permission, role=orgr, service=microlocation) # For COORGANIZER perm, _ = get_or_create(Permission, role=coorgr, service=track) perm.can_create, perm.can_delete = False, False db.session.add(perm) perm, _ = get_or_create(Permission, role=coorgr, service=session) perm.can_create, perm.can_delete = False, False db.session.add(perm) perm, _ = get_or_create(Permission, role=coorgr, service=speaker) perm.can_create, perm.can_delete = False, False db.session.add(perm) perm, _ = get_or_create(Permission, role=coorgr, service=sponsor) perm.can_create, perm.can_delete = False, False db.session.add(perm) perm, _ = get_or_create(Permission, role=coorgr, service=microlocation) perm.can_create, perm.can_delete = False, False db.session.add(perm) # For TRACK_ORGANIZER perm, _ = get_or_create(Permission, role=track_orgr, service=track) db.session.add(perm) # For MODERATOR perm, _ = get_or_create(Permission, role=mod, service=track) perm.can_create, perm.can_update, perm.can_delete = False, False, False db.session.add(perm)
def create_settings(): get_or_create(Setting, app_name='Open Event')
def get_owner(event, user): role, _ = get_or_create(Role, name='owner', title_name='Owner') UsersEventsRoles(user=user, event=event, role=role) return user
def create_speaker_image_sizes(): get_or_create( ImageSizes, type='speaker-image', icon_size_width_height=35, icon_size_quality=80, small_size_width_height=50, small_size_quality=80, thumbnail_size_width_height=500, thumbnail_quality=80 )
def create_panels(): panels = [SALES, ADMIN, EVENTS, SESSIONS, USERS, PERMISSIONS, MESSAGES, REPORTS, SETTINGS, CONTENT] for panel in panels: perm, _ = get_or_create(PanelPermission, panel_name=panel) db.session.add(perm)
def create_roles(): get_or_create(Role, name=ORGANIZER, title_name='Organizer') get_or_create(Role, name=COORGANIZER, title_name='Co-organizer') get_or_create(Role, name=TRACK_ORGANIZER, title_name='Track Organizer') get_or_create(Role, name=MODERATOR, title_name='Moderator') get_or_create(Role, name=ATTENDEE, title_name='Attendee') get_or_create(Role, name=REGISTRAR, title_name='Registrar') get_or_create(Role, name=OWNER, title_name='Owner')
def create_roles(): get_or_create(Role, name=ORGANIZER, title_name='Organizer') get_or_create(Role, name=COORGANIZER, title_name='Co-organizer') get_or_create(Role, name=TRACK_ORGANIZER, title_name='Track Organizer') get_or_create(Role, name=MODERATOR, title_name='Moderator') get_or_create(Role, name=ATTENDEE, title_name='Attendee') get_or_create(Role, name=REGISTRAR, title_name='Registrar')