fairdm.contrib.plugins.mixins#

Mixins that decide how a refused plugin page answers and where its Back control points.

Module Contents#

Classes#

PrivateRecordNotFoundMixin

Answer 404 rather than 403 or a sign-in redirect for a private record.

RecordOwnPageBackFallbackMixin

Send a deletion page’s Back control to the record’s own page rather than its list.

API#

class PrivateRecordNotFoundMixin[source]#

Answer 404 rather than 403 or a sign-in redirect for a private record.

A 403 or a redirect would confirm that a private record exists at this address. The 404 message names the record’s kind from registered_model.

List this mixin before Plugin, and before FairDMDeleteView on a deletion page, so its handle_no_permission wins in the MRO.

handle_no_permission()[source]#

Raise a 404 for a non-public record, otherwise refuse as usual.

class RecordOwnPageBackFallbackMixin[source]#

Send a deletion page’s Back control to the record’s own page rather than its list.

List this mixin before FairDMDeleteView, for the same MRO reason as :class:PrivateRecordNotFoundMixin.

get_back_url_fallback() → str[source]#

Return the record’s own page.