slm.signals

All SLM specific Signals sent by the system are defined here. These signals mostly include events relating to the site log edit/moderate/publish life cycle.

All signals contain a request object that holds the request that initiated the event. This object is provided mostly for logging purposes and is not guaranteed to be non-null.

slm.signals.site_proposed = <django.dispatch.dispatcher.Signal object>

Signal sent when a new site is proposed.

Parameters:
  • sender – The sending object (unreliable).

  • site – The Site object.

  • user – The user that proposed the new site.

  • timestamp – The time the request was received

  • request – The Django request object that initiated the proposal.

  • agencies – The Agencies identified by the requester as the responsible agencies.

  • kwargs – Misc other key word arguments

slm.signals.site_published = <django.dispatch.dispatcher.Signal object>

Sent when a site log is published, or when a section of a site log is published.

Parameters:
  • sender – The sending object (unreliable).

  • site – The Site object.

  • user – The user that published the site log.

  • timestamp – The time the site log was published.

  • request – The Django request object that initiated the publish.

  • section – None if the entire site log was published, if an individual section was published this will be the Section object instance.

  • kwargs – Misc other key word arguments

slm.signals.site_status_changed = <django.dispatch.dispatcher.Signal object>

Sent when a site log’s status changes. Its possible that both the previous and new status states are Published. If this happens a site log was edited and published simultaneously. The published timestamp will have increased.

Parameters:
  • sender – The sending object (unreliable).

  • site – The Site object.

  • previous_status – The previous status

  • new_status – The new status

  • reverted – If true this status change was the result of a reversion

  • kwargs – Misc other key word arguments

slm.signals.section_edited = <django.dispatch.dispatcher.Signal object>

Sent when a site log section is edited.

Parameters:
  • sender – The sending object (unreliable).

  • site – The Site object.

  • user – The user that edited the site log section.

  • timestamp – The time the site log section was edited.

  • request – The Django request object that contained the edit.

  • section – The section object that was edited.

  • fields – The list of edited fields

  • kwargs – Misc other key word arguments

slm.signals.section_added = <django.dispatch.dispatcher.Signal object>

Sent when a site log section is added.

Parameters:
  • sender – The sending object (unreliable).

  • site – The Site object.

  • user – The user that added the site log section.

  • timestamp – The time the site log section was added.

  • request – The Django request object that contained the add.

  • section – The section object that was added.

  • kwargs – Misc other key word arguments

slm.signals.section_deleted = <django.dispatch.dispatcher.Signal object>

Sent when a site log section is deleted.

Parameters:
  • sender – The sending object (unreliable).

  • site – The Site object.

  • user – The user that deleted the site log section.

  • timestamp – The time the site log section was deleted.

  • request – The Django request object that contained the delete.

  • section – The section object that was deleted.

  • kwargs – Misc other key word arguments

slm.signals.fields_flagged = <django.dispatch.dispatcher.Signal object>

Sent when a site log section has fields flagged.

Parameters:
  • sender – The sending object (unreliable).

  • site – The Site object.

  • user – The user that added the flags or performed the action that caused the flags to be added.

  • timestamp – The time the site log section was flagged.

  • request – The Django request object that added or triggered the flags.

  • section – The section object concerned.

  • fields – The list of fields that were flagged.

  • kwargs – Misc other key word arguments

slm.signals.flags_cleared = <django.dispatch.dispatcher.Signal object>

Sent when a site log section has fields flagged.

Parameters:
  • sender – The sending object (unreliable).

  • site – The Site object.

  • user – The user that removed the flags or performed the action that caused the flags to be removed.

  • timestamp – The time the site log section was flagged.

  • request – The Django request object that removed or triggered the flags to be cleared.

  • section – The section object concerned.

  • fields – The list of fields that were cleared of flags.

  • clear – True if the section has no remaining flags - false otherwise.

  • kwargs – Misc other key word arguments

slm.signals.site_file_uploaded = <django.dispatch.dispatcher.Signal object>

Sent when a user uploads a site log.

Parameters:
  • sender – The sending object (unreliable).

  • site – The Site object.

  • user – The user that uploaded the site log.

  • timestamp – The time the site log was uploaded.

  • request – The Django request object that contained the upload.

  • upload – The uploaded file (SiteFileUpload).

  • kwargs – Misc other key word arguments

slm.signals.site_file_published = <django.dispatch.dispatcher.Signal object>

Sent when a moderator publishes a site file upload - could be an attachment or an image.

Parameters:
  • sender – The sending object (unreliable).

  • site – The Site object.

  • user – The user that published the file.

  • timestamp – The time the file was published.

  • request – The Django request object that contained the upload.

  • upload – The uploaded file (SiteFileUpload).

  • kwargs – Misc other key word arguments

slm.signals.site_file_unpublished = <django.dispatch.dispatcher.Signal object>

Sent when a moderator retracts a site file upload - could be an attachment or an image.

Parameters:
  • sender – The sending object (unreliable).

  • site – The Site object.

  • user – The user that unpublished the file.

  • timestamp – The time the file was unpublished.

  • request – The Django request object that contained the upload.

  • upload – The uploaded file (SiteFileUpload).

  • kwargs – Misc other key word arguments

slm.signals.site_file_deleted = <django.dispatch.dispatcher.Signal object>

Sent when a user deletes a site file upload through the API. The file must be a type other than a site log - could be an attachment or an image.

Parameters:
  • sender – The sending object (unreliable).

  • site – The Site object.

  • user – The user that deleted the file.

  • timestamp – The time the file was deleted.

  • request – The Django request object that contained the upload.

  • upload – The uploaded file (SiteFileUpload).

  • kwargs – Misc other key word arguments

slm.signals.review_requested = <django.dispatch.dispatcher.Signal object>

Sent when a user requests a site log be reviewed and published by moderators.

Parameters:
  • sender – The sending object (unreliable).

  • site – The site the reviews were requested for.

  • detail – The user given reasons for requesting the update (if any).

  • request – The Django request object that contained the request.

  • kwargs – Misc other key word arguments

slm.signals.updates_rejected = <django.dispatch.dispatcher.Signal object>

Sent when a moderator rejects edits requested for publish in a review request.

Parameters:
  • sender – The sending object (unreliable).

  • site – The site the updates were rejected for.

  • detail – The user given reasons for rejecting the update (if any).

  • request – The Django request object that contained the rejection.

  • kwargs – Misc other key word arguments

slm.signals.alert_issued = <django.dispatch.dispatcher.Signal object>

Sent when an alert is issued.

Parameters:
  • sender – The sending object (unreliable).

  • alert – The alert object that was issued.

  • kwargs – Misc other key word arguments

slm.signals.alert_cleared = <django.dispatch.dispatcher.Signal object>

Sent when an alert is cleared.

Parameters:
  • sender – The sending object (unreliable).

  • alert – The alert object that was issued.

  • kwargs – Misc other key word arguments

slm.signals.signal_name(signal)[source]

Given a signal object - try to determine its name (import path). This is not easy and prone to failure so don’t use it for anything critical.