Beispiel #1
0
def create_user_offerer(user: User,
                        offerer: Offerer,
                        idx: int = None,
                        validation_token: str = None) -> UserOfferer:
    user_offerer = UserOfferer()
    user_offerer.id = idx
    user_offerer.offerer = offerer
    user_offerer.user = user
    user_offerer.validationToken = validation_token

    return user_offerer
Beispiel #2
0
def create_user_offerer(user: User,
                        offerer: Offerer,
                        idx: int = None,
                        is_admin: bool = False,
                        validation_token: str = None) -> UserOfferer:
    user_offerer = UserOfferer()
    user_offerer.id = idx
    user_offerer.offerer = offerer
    user_offerer.rights = RightsType.admin if is_admin else RightsType.editor
    user_offerer.user = user
    user_offerer.validationToken = validation_token

    return user_offerer