コード例 #1
0
 def _send_notification(request, message, exception, error):
     """
     Send notification to the list of entities or call the specific methods
     :param request: request object
     :param message: message having frame details
     :param exception: exception that's triggered
     :param error:  error model object
     :return: None
     """
     if notifier is None:
         return
     if request is not None:
         method = request.method
         url = request.get_full_path()
     else:
         method = ""
         url = ""
     subject = get_notification_subject(APP_ERROR_SUBJECT_PREFIX,
                                        method, url, exception)
     notifier.notify(request,
                     error,
                     email_subject=subject,
                     email_body=message,
                     from_email=APP_ERROR_EMAIL_SENDER,
                     recipient_list=APP_ERROR_RECIPIENT_EMAIL)
コード例 #2
0
 def _send_notification(self, url, method, message, exception, error):
     subject = get_notification_subject(self.notification_subject_prefix,
                                        method, url, exception)
     self.notifier.notify(request,
                          error,
                          email_subject=subject,
                          email_body=message,
                          from_email=self.notification_sender,
                          recipient_list=self.recipients)