Change admin email subject

pull/6/head
Yax 10 years ago
parent c23154fbab
commit dfd1ea41d8

@ -87,7 +87,7 @@ def new_comment(data):
# send email # send email
# TODO subject should embed a key # TODO subject should embed a key
subject = '%s: [%s:%d]' % (site.name, token, comment.id) subject = '%s: [%d:%s]' % (site.name, comment.id, token)
mail(site.admin_email, subject, email_body) mail(site.admin_email, subject, email_body)
# TODO support subscription # TODO support subscription
@ -108,9 +108,9 @@ def reply_comment_email(data):
message = part['content'] message = part['content']
break break
m = re.search('\[(\w+)\:(\d+)\]', subject) m = re.search('\[(\d+)\:(\w+)\]', subject)
token = m.group(1) comment_id = int(m.group(1))
comment_id = int(m.group(2)) token = m.group(2)
# retrieve site and comment rows # retrieve site and comment rows
comment = Comment.select().where(Comment.id == comment_id).get() comment = Comment.select().where(Comment.id == comment_id).get()

Loading…
Cancel
Save