org.app
Contains the base application used by other applications.
Classes
Functions
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Returns a list of message types which are availble on the ticket |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Module Contents
- class org.app.OrgApp[source]
Bases:
onegov.core.Framework,onegov.reservation.LibresIntegration,onegov.search.SearchApp,onegov.gis.MapboxApp,onegov.file.DepotApp,onegov.pay.PayApp,onegov.form.FormApp,onegov.user.UserApp,onegov.websockets.WebsocketsApp,onegov.api.ApiApp- is_allowed_application_id(application_id: str) bool[source]
Stops onegov.server from ever passing the request to the org application, if the schema does not exist. This way we can host onegov.org in a way that allows all requests to
*.example.org.If the schema for
newyork.example.orgexists, the request is handled. If the schema does not exist, the request is not handled.Here we basically decide if an org exists or not.
- configure_organisation(*, enable_user_registration: bool = False, enable_yubikey: bool = False, disable_password_reset: bool = False, **cfg: Any) None[source]
- configure_infomaniak_api_token(*, infomaniak_api_token: str | None = None, infomaniak_product_id: str | None = None, **cfg: Any) None[source]
- configure_mtan_hook(**cfg: Any) None[source]
This inserts an mtan hook by wrapping the callable we receive from the key lookup on get_view.
We only need to do this once per application instance and we don’t risk contaminating other applications, since each instance has its own dispatch callable.
This relies heavily on implementation details of reg.dispatch_method and is thus a little bit fragile, take care when upgrading to newer versions of reg!
- ticket_permissions() dict[str, dict[str | None, list[str]]][source]
Exclusive ticket permissions for authorization.
- prepare_email(reply_to: email.headerregistry.Address | str | None = None, category: Literal['marketing', 'transactional'] = 'marketing', receivers: onegov.core.types.SequenceOrScalar[email.headerregistry.Address | str] = (), cc: onegov.core.types.SequenceOrScalar[email.headerregistry.Address | str] = (), bcc: onegov.core.types.SequenceOrScalar[email.headerregistry.Address | str] = (), subject: str | None = None, content: str | None = None, attachments: collections.abc.Iterable[onegov.core.mail.Attachment | _typeshed.StrPath] = (), headers: dict[str, str] | None = None, plaintext: str | None = None) onegov.core.types.EmailJsonDict[source]
Wraps
onegov.core.framework.Framework.prepare_email(), setting the reply_to address by using the reply address from the organisation settings.
- load_custom_texts() dict[str, str] | None[source]
Customer specific texts are specified in puppet repo, see loxo https://gitea.seantis.ch/operations/puppet/src/branch/master/nodes/loxo.seantis.ch.yaml#L183,193
Remember to create customtexts.yml in your local dev setup /usr/local/var/onegov/files/<org>/customtexts.yml
Example customtexts.yml: ```yaml custom texts:
(en) Custom admission course agreement: I agree to attend the .. (de) Custom admission course agreement: Ich erkläre mich bereit, ..
- checkout_button(button_label: str, title: str, price: onegov.pay.Price | None, email: str, complete_url: str, request: onegov.org.request.OrgRequest) str | None[source]
- redirect_after_login(identity: onegov.core.Identity | morepath.authentication.NoIdentity, request: onegov.org.request.OrgRequest, default: str) str | None[source]
Returns the path to redirect after login, given the request and the default login path, which is usually the current path.
Returns a path or None, if the default should be used.
- org.app.get_locale_negotiator() collections.abc.Callable[[collections.abc.Sequence[str], onegov.org.request.OrgRequest], str | None][source]
- org.app.get_create_new_organisation_factory() collections.abc.Callable[[OrgApp, str], onegov.org.models.Organisation][source]
- org.app.get_is_complete_userprofile_handler() collections.abc.Callable[[onegov.org.request.OrgRequest, str], bool][source]
- org.app.get_public_ticket_messages() collections.abc.Collection[str][source]
Returns a list of message types which are availble on the ticket status page, visible to anyone that knows the unguessable url.
- org.app.get_render_mtan_access_limit_exceeded() collections.abc.Callable[[onegov.org.exceptions.MTANAccessLimitExceeded, onegov.org.request.OrgRequest], webob.Response][source]
- org.app.enable_iframes_tween_factory(app: OrgApp, handler: collections.abc.Callable[[onegov.org.request.OrgRequest], webob.Response]) collections.abc.Callable[[onegov.org.request.OrgRequest], webob.Response][source]
- org.app.wrap_with_mtan_hook(func: collections.abc.Callable[[OrgApp, Any, onegov.org.request.OrgRequest], Any]) collections.abc.Callable[[OrgApp, Any, onegov.org.request.OrgRequest], Any][source]