Source code for gazette.views

from onegov.user import UserCollection

from typing import TYPE_CHECKING
    from onegov.gazette.request import GazetteRequest
    from onegov.user import User
    from uuid import UUID

[docs] def get_user(request: 'GazetteRequest') -> 'User | None': username = request.identity.userid if username is None: return None session = request.session return UserCollection(session).by_username(username)
[docs] def get_user_and_group( request: 'GazetteRequest' ) -> tuple[list['UUID'], list['UUID']]: user = get_user(request) return ( [] if (user and not else [], [] if (user and else [] )