comparison roundup/roundupdb.py @ 3877:83748b2de465

Make addition of line about new submission/comment at top of each message... ...configurable Make presence of e-mail address in the added line configurable.
author Erik Forsberg <forsberg@users.sourceforge.net>
date Sat, 01 Sep 2007 16:30:11 +0000
parents 9171e01ac932
children 46ef2a6fd79d
comparison
equal deleted inserted replaced
3876:29759dfcfbcf 3877:83748b2de465
14 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 14 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
15 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" 15 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS"
16 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, 16 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
17 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. 17 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
18 # 18 #
19 # $Id: roundupdb.py,v 1.128 2006-12-18 11:34:41 a1s Exp $ 19 # $Id: roundupdb.py,v 1.129 2007-09-01 16:30:11 forsberg Exp $
20 20
21 """Extending hyperdb with types specific to issue-tracking. 21 """Extending hyperdb with types specific to issue-tracking.
22 """ 22 """
23 __docformat__ = 'restructuredtext' 23 __docformat__ = 'restructuredtext'
24 24
290 # "system message" 290 # "system message"
291 authid = None 291 authid = None
292 authname = 'admin' 292 authname = 'admin'
293 authaddr = self.db.config.ADMIN_EMAIL 293 authaddr = self.db.config.ADMIN_EMAIL
294 294
295 if authaddr: 295 if authaddr and self.db.config.MAIL_ADD_AUTHOREMAIL:
296 authaddr = " <%s>" % straddr( ('',authaddr) ) 296 authaddr = " <%s>" % straddr( ('',authaddr) )
297 elif authaddr:
298 authaddr = ""
297 299
298 # make the message body 300 # make the message body
299 m = [''] 301 m = ['']
300 302
301 # put in roundup's signature 303 # put in roundup's signature
302 if self.db.config.EMAIL_SIGNATURE_POSITION == 'top': 304 if self.db.config.EMAIL_SIGNATURE_POSITION == 'top':
303 m.append(self.email_signature(nodeid, msgid)) 305 m.append(self.email_signature(nodeid, msgid))
304 306
305 # add author information 307 # add author information
306 if authid: 308 if authid and self.db.config.MAIL_ADD_AUTHORINFO:
307 if len(self.get(nodeid,'messages')) == 1: 309 if len(self.get(nodeid,'messages')) == 1:
310
308 m.append(_("New submission from %(authname)s%(authaddr)s:") 311 m.append(_("New submission from %(authname)s%(authaddr)s:")
309 % locals()) 312 % locals())
310 else: 313 else:
311 m.append(_("%(authname)s%(authaddr)s added the comment:") 314 m.append(_("%(authname)s%(authaddr)s added the comment:")
312 % locals()) 315 % locals())
313 else: 316 m.append('')
317 elif self.db.config.MAIL_ADD_AUTHORINFO:
314 m.append(_("System message:")) 318 m.append(_("System message:"))
315 m.append('') 319 m.append('')
316 320
317 # add the content 321 # add the content
318 if msgid is not None: 322 if msgid is not None:
319 m.append(messages.get(msgid, 'content', '')) 323 m.append(messages.get(msgid, 'content', ''))
320 324

Roundup Issue Tracker: http://roundup-tracker.org/