gazette.views.notice_states

Module Contents

Functions

send_accepted_mail(→ None)

Sends a mail to the publisher with the contents of the notice.

submit_notice(→ RenderData | Response)

Submit a notice.

accept_notice(→ RenderData | Response)

Accept a notice.

reject_notice(→ RenderData | Response)

Reject a notice.

gazette.views.notice_states.send_accepted_mail(request: onegov.gazette.request.GazetteRequest, notice: onegov.gazette.models.GazetteNotice) None[source]

Sends a mail to the publisher with the contents of the notice.

We use named temporary files because the files stored by depot does not have a nice filename (which is automatically used by mailton) and to allow temporary files from the memory without a real file on the disk.

gazette.views.notice_states.submit_notice(self: onegov.gazette.models.GazetteNotice, request: onegov.gazette.request.GazetteRequest, form: onegov.gazette.forms.EmptyForm) RenderData | Response[source]

Submit a notice.

This view is used by the editors to submit their drafts for the publishers to review.

Only drafted notices may be submitted. Editors may only submit their own notices (publishers may submit any notice).

If a notice has invalid/past issues or an invalid/inactive category/organization, the user is redirected to the edit view.

gazette.views.notice_states.accept_notice(self: onegov.gazette.models.GazetteNotice, request: onegov.gazette.request.GazetteRequest, form: onegov.gazette.forms.EmptyForm) RenderData | Response[source]

Accept a notice.

This view is used by the publishers to accept a submitted notice.

Only submitted notices may be accepted.

gazette.views.notice_states.reject_notice(self: onegov.gazette.models.GazetteNotice, request: onegov.gazette.request.GazetteRequest, form: onegov.gazette.forms.RejectForm) RenderData | Response[source]

Reject a notice.

This view is used by the publishers to reject a submitted notice.

Only submitted notices may be rejected.