pas.collections.parliamentarian
Attributes
Classes
Module Contents
- class pas.collections.parliamentarian.PASParliamentarianCollection(app: onegov.core.Framework, **kwargs: Any)[source]
Bases:
onegov.parliament.collections.ParliamentarianCollection[onegov.pas.models.PASParliamentarian]- _is_current_commission_president(item: onegov.pas.models.PASParliamentarian) bool[source]
Check if the parliamentarian is currently a president of any commission.
- update_user(item: onegov.pas.models.PASParliamentarian, new_email: str | None, users_cache: dict[str, Any] | None = None) None[source]
Keep the parliamentarian and its user account in sync.
Creates a new user account if an email address is set (if not already existing).
Disable user accounts if an email has been deleted.
Change usernames if an email has changed.
Make sure used user accounts have the right role.
Make sure used user accounts are activated.
Make sure the password is changed if activated or disabled.
Optional users_cache parameter allows to pre-fetch the users to avoid N+1 queries.