fairdm.contrib.contributors.plugins.update#

The page where a contributor’s profile is edited.

Module Contents#

Classes#

Update

Edit a contributor’s profile.

Functions#

contributor_is_editable

Say whether the request’s user may open the editing page for a contributor.

API#

contributor_is_editable(request, contributor)#

Say whether the request’s user may open the editing page for a contributor.

An additional view is governed by its own check, not its owner’s, so the overview’s rule for who may look at a profile does not apply here. Plugin asks on every request, so a right lost while the page is open refuses the save.

Args: request: The current request. contributor: The contributor, or None when no record has been resolved.

Returns: True when the contributor’s is_editable_by accepts the user.

class Update(**kwargs)#

Bases: fairdm.contrib.plugins.Plugin, fairdm.views.FairDMUpdateView

Edit a contributor’s profile.

An additional view of the overview plugin, so the navigation strip carries one entry for the whole collection. Which form it shows is read from FAIRDM_PROFILE_FORMS for the kind of contributor, and falls back to the form the package ships.

Attributes: shipped_forms: The form each kind of contributor is edited with when the setting names none.

Initialization

Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.

url_path#

‘update’

model#

None

check#

‘staticmethod(…)’

page_title#

‘_(…)’

success_message#

‘_(…)’

template_name#

‘contributors/plugins/update.html’

shipped_forms#

None

get_form_class()#

Use the portal’s form for this kind of contributor, else the shipped one.

get_page_title()#

Title the page for a person or an organization, with no model name interpolated.

get_success_url()#

Return to the contributor’s own page.

get_context_data(**kwargs)#

Add where Cancel leads and the account centre’s address.