Exemplo n.º 1
0
from indico.web.flask.templating import get_template_module
from indico.web.flask.util import url_for
from indico.web.menu import SideMenuItem

__all__ = ('ExtraUserPreferences', 'User', 'UserSetting', 'UserSettingsProxy',
           'user_settings')

logger = Logger.get('users')

user_settings = UserSettingsProxy(
    'users',
    {
        'lang': None,
        'timezone': None,
        'force_timezone':
        False,  # always use the user's timezone instead of an event's timezone
        'show_past_events': False,
        'use_previewer_pdf': True,
        'synced_fields':
        None,  # None to synchronise all fields, empty set to not synchronize
        'suggest_categories':
        False  # whether the user should receive category suggestions
    })

user_management_settings = SettingsProxy('user_management',
                                         {'notify_account_creation': False})


@signals.menu.items.connect_via('admin-sidemenu')
def _extend_admin_menu(sender, **kwargs):
    return SideMenuItem('users',
                        _("Users"),
Exemplo n.º 2
0
from indico.web.menu import SideMenuItem, TopMenuItem

__all__ = ('ExtraUserPreferences', 'User', 'UserSetting', 'UserSettingsProxy',
           'user_settings')

logger = Logger.get('users')

user_settings = UserSettingsProxy(
    'users',
    {
        'lang': None,
        'timezone': None,
        'force_timezone':
        False,  # always use the user's timezone instead of an event's timezone
        'show_future_events': False,
        'show_past_events': False,
        'name_format': NameFormat.first_last,
        'use_previewer_pdf': True,
        'synced_fields':
        None,  # None to synchronize all fields, empty set to not synchronize
        'suggest_categories':
        False  # whether the user should receive category suggestions
    },
    converters={'name_format': EnumConverter(NameFormat)})

user_management_settings = SettingsProxy('user_management',
                                         {'notify_account_creation': False})


@signals.category.deleted.connect
def _category_deleted(category, **kwargs):
Exemplo n.º 3
0
from indico.modules.users.models.settings import UserSetting, UserSettingsProxy
from indico.util.i18n import _
from indico.web.flask.util import url_for
from indico.web.menu import SideMenuItem

__all__ = ('ExtraUserPreferences', 'User', 'UserSetting', 'UserSettingsProxy',
           'user_settings')

logger = Logger.get('users')

user_settings = UserSettingsProxy(
    'users',
    {
        'lang': None,
        'timezone': None,
        'force_timezone':
        False,  # always use the user's timezone instead of an event's timezone
        'show_past_events': False,
        'use_previewer_pdf': True,
        'synced_fields':
        None  # None to synchronise all fields, empty set to not synchronize
    })


@signals.menu.items.connect_via('admin-sidemenu')
def _extend_admin_menu(sender, **kwargs):
    return SideMenuItem('users',
                        _("Users"),
                        url_for('users.users_admin'),
                        section='user_management')