rattail.problems.handlers
¶
Problem Report Handlers
- class rattail.problems.handlers.ProblemReportHandler(config, dry_run=False, progress=None)[source]¶
Base class and default implementation for problem report handlers.
- get_all_problem_reports()[source]¶
Returns a simple list of all
ProblemReport
subclasses which are “available” according to config.
- get_global_email_context(**kwargs)[source]¶
This method can be used to add extra context for all email templates.
- get_problem_report(system_key, problem_key, **kwargs)[source]¶
Return a specific problem report, identified by the system/problem key pair.
- get_problem_reports(systems=None, problems=None)[source]¶
Return a list of all problem reports which match the given criteria.
- Parameters:
- Returns:
List of problem reports; may be an empty list.
- get_report_email_context(report, problems, **kwargs)[source]¶
This method can be used to add extra context for a specific report’s email template.
- normalize_problem_report(report, include_schedule=False, include_recipients=False, **kwargs)[source]¶
Return a normalized data dictionary for the given problem report.
- run_problem_report(problem_report, fix=False, send=True, force=False, **kwargs)[source]¶
Run the given problem report, if it is enabled and scheduled to run for the current day.
- Parameters:
force¶ – If true, the report will run regardless of whether it is enabled at all / for the current day. If false (the default) then the report’s enabled flags will determine whether we should actually run it now.
- run_problem_reports(reports, fix=False, force=False, **kwargs)[source]¶
Run the given set of problem reports.
- Parameters:
fix¶ – This flag will be passed as-is to
run_problem_report()
.
- send_problem_report(report, problems)[source]¶
Send out an email with details of the given problem report.
- rattail.problems.handlers.get_problem_report_handler(config, **kwargs)[source]¶
Create and return the configured
ProblemReportHandler
instance.