• R/O
  • HTTP
  • SSH
  • HTTPS

コミット

タグ
未設定

よく使われているワード(クリックで追加)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

allura


コミットメタ情報

リビジョンca6116cd20bae26533ce7ecb7f79b919904c3fce (tree)
日時2012-05-31 02:25:16
作者Dave Brondsema <dbrondsema@geek...>
コミッターDave Brondsema

ログメッセージ

[#4296] make all noreply hardcoded addresses be unicode

変更サマリ

差分

--- a/Allura/allura/lib/mail_util.py
+++ b/Allura/allura/lib/mail_util.py
@@ -149,7 +149,7 @@ def _parse_smtp_addr(addr):
149149 addrs = _parse_message_id(addr)
150150 if addrs and addrs[0]: return addrs[0]
151151 if '@' in addr: return addr
152- return 'noreply@in.sf.net'
152+ return u'noreply@in.sf.net'
153153
154154 def isvalid(addr):
155155 '''return True if addr is a (possibly) valid email address, false
--- a/Allura/allura/model/discuss.py
+++ b/Allura/allura/model/discuss.py
@@ -217,7 +217,7 @@ class Thread(Artifact):
217217 link=artifact.url(),
218218 _id=artifact.url()+post._id,
219219 from_address=str(author._id) if author != User.anonymous() else None,
220- reply_to_address='noreply@in.sf.net',
220+ reply_to_address=u'noreply@in.sf.net',
221221 subject=subject,
222222 text=text,
223223 in_reply_to=post.parent_id,
--- a/Allura/allura/model/notification.py
+++ b/Allura/allura/model/notification.py
@@ -133,7 +133,7 @@ class Notification(MappedClass):
133133 _id=artifact.url()+post._id,
134134 from_address=str(author._id) if author != User.anonymous() else None,
135135 reply_to_address='"%s" <%s>' % (
136- subject_prefix, getattr(artifact, 'email_address', 'noreply@in.sf.net')),
136+ subject_prefix, getattr(artifact, 'email_address', u'noreply@in.sf.net')),
137137 subject=subject_prefix + subject,
138138 text=text,
139139 in_reply_to=post.parent_id,
@@ -144,7 +144,7 @@ class Notification(MappedClass):
144144 idx['title_s'],c.user.get_pref('display_name')))
145145 reply_to = '"%s" <%s>' % (
146146 idx['title_s'],
147- getattr(artifact, 'email_address', 'noreply@in.sf.net'))
147+ getattr(artifact, 'email_address', u'noreply@in.sf.net'))
148148 d = dict(
149149 from_address=reply_to,
150150 reply_to_address=reply_to,
@@ -509,9 +509,9 @@ class Mailbox(MappedClass):
509509 self.user_id, from_address, subject, ns, reply_to_address)
510510 elif self.type == 'digest':
511511 Notification.send_digest(
512- self.user_id, 'noreply@in.sf.net', 'Digest Email',
512+ self.user_id, u'noreply@in.sf.net', 'Digest Email',
513513 notifications)
514514 elif self.type == 'summary':
515515 Notification.send_summary(
516- self.user_id, 'noreply@in.sf.net', 'Digest Email',
516+ self.user_id, u'noreply@in.sf.net', 'Digest Email',
517517 notifications)
--- a/Allura/allura/model/repository.py
+++ b/Allura/allura/model/repository.py
@@ -255,7 +255,7 @@ class Repository(Artifact):
255255 @property
256256 def email_address(self):
257257 domain = '.'.join(reversed(self.app.url[1:-1].split('/'))).replace('_', '-')
258- return 'noreply@%s%s' % (domain, config.common_suffix)
258+ return u'noreply@%s%s' % (domain, config.common_suffix)
259259
260260 def index(self):
261261 result = Artifact.index(self)
--- a/Allura/allura/tasks/mail_tasks.py
+++ b/Allura/allura/tasks/mail_tasks.py
@@ -64,13 +64,13 @@ def sendmail(fromaddr, destinations, text, reply_to, subject,
6464 addrs_html = []
6565 addrs_multi = []
6666 if fromaddr is None:
67- fromaddr = 'noreply@in.sf.net'
67+ fromaddr = u'noreply@in.sf.net'
6868 elif '@' not in fromaddr:
6969 log.warning('Looking up user with fromaddr %s', fromaddr)
7070 user = M.User.query.get(_id=ObjectId(fromaddr))
7171 if not user:
7272 log.warning('Cannot find user with ID %s', fromaddr)
73- fromaddr = 'noreply@in.sf.net'
73+ fromaddr = u'noreply@in.sf.net'
7474 else:
7575 fromaddr = user.email_address_header()
7676 # Divide addresses based on preferred email formats
@@ -126,13 +126,13 @@ def sendsimplemail(
126126 in_reply_to=None):
127127 from allura import model as M
128128 if fromaddr is None:
129- fromaddr = 'noreply@in.sf.net'
129+ fromaddr = u'noreply@in.sf.net'
130130 elif '@' not in fromaddr:
131131 log.warning('Looking up user with fromaddr %s', fromaddr)
132132 user = M.User.query.get(_id=ObjectId(fromaddr))
133133 if not user:
134134 log.warning('Cannot find user with ID %s', fromaddr)
135- fromaddr = 'noreply@in.sf.net'
135+ fromaddr = u'noreply@in.sf.net'
136136 else:
137137 fromaddr = user.email_address_header()
138138 plain_msg = mail_util.encode_email_part(text, 'plain')