Hello,

We needed to make a change that allowed us to modify the prefix of
emails sent out when an error was raised.  The attached patch seems to
do the trick.

...however, I'm not sure if it is the best way to do it?  At this
point we end up adding

error_subject_prefix = [site] [application_name]

to the config, whereas [application_name] is already added without
this variable set.  Maybe there is a better place to set this
variable, so that we don't have to have this redundancy?

Index: paste/exceptions/errormiddleware.py
===================================================================
--- paste/exceptions/errormiddleware.py	(revision 6646)
+++ paste/exceptions/errormiddleware.py	(working copy)
@@ -111,7 +111,8 @@
         if smtp_server is None:
             smtp_server = global_conf.get('smtp_server', 'localhost')
         self.smtp_server = smtp_server
-        self.error_subject_prefix = error_subject_prefix or ''
+        self.error_subject_prefix = global_conf.get('error_subject_prefix') \
+            or error_subject_prefix or ''
         if error_message is None:
             error_message = global_conf.get('error_message')
         self.error_message = error_message
_______________________________________________
Paste-users mailing list
[email protected]
http://webwareforpython.org/cgi-bin/mailman/listinfo/paste-users

Reply via email to