akvo.rsr.signals module

akvo.rsr.signals.act_on_log_entry(sender, **kwargs)[source]

catch the LogEntry post_save to grab newly added Project instances and create Benchmark objects for it we do this at this time to be able to work with a fully populated Project instance

akvo.rsr.signals.change_name_of_file_on_change(sender, **kwargs)[source]

call to create a filename when saving the changes of a model with the pattern ModelName_instance.pk_FieldName_YYYY-MM-DD_HH.MM.SS.ext this is done before saving the model

akvo.rsr.signals.change_name_of_file_on_create(sender, **kwargs)[source]

call to create a filename when creating a new model instance with the pattern ModelName_instance.pk_FieldName_YYYY-MM-DD_HH.MM.SS.ext Since we cannot do this until the instance of the model has been saved we do it as a post_save signal callback

akvo.rsr.signals.create_benchmark_objects(project)[source]

create the relevant Benchmark objects for this project based on the Categories of the project

akvo.rsr.signals.create_organisation_account(sender, **kwargs)[source]

called when a new organisation is saved so an associated org account is created with the “free” level of access to widgets

akvo.rsr.signals.create_publishing_status(sender, **kwargs)[source]

called when a new project is saved so an associated published record for the project is created

akvo.rsr.signals.employment_post_save(sender, **kwargs)[source]

For all employments: - Set User to is_staff (for admin access) when the employment is approved and the Group is set

to ‘Project Editors’, ‘User managers’ or ‘Admins’, or when the user is a superuser or general admin.

If a new employment is created for an active user of which the employment is not approved yet: - Inform RSR support users, organisation admins and organisation user managers of the request

akvo.rsr.signals.employment_pre_save(sender, **kwargs)[source]

This signal intends to send a mail to the user when his/her account has been approved.

This signal also sets ‘Users’ Group for the employment if no group has been set

A mail will be sent when:

  • A new employment is created with is_approved = True. * We assume this happens when an existing user is invited for a new organisation.

  • An existing employment is updated from is_approved = False changed to True. * We assume this happens when an existing user has requested to join an organisation himself.

akvo.rsr.signals.set_focus_org(instance, created, **kwargs)[source]
akvo.rsr.signals.set_showcase_project(instance, created, **kwargs)[source]
akvo.rsr.signals.update_project_budget(sender, **kwargs)[source]

called when BudgetItem objects are added/changed/deleted

akvo.rsr.signals.update_project_funding(sender, **kwargs)[source]

called when Partnership objects are added/changed/deleted