Commit 19759c0a8360f86baf81b10fe7e8f7e059bb7577

Authored by Luan
2 parents 2cbafa78 7081b5db

Merge branch 'master' of github.com:TracyWebTech/colab

Conflicts:
	src/locale/pt_BR/LC_MESSAGES/django.mo
	src/locale/pt_BR/LC_MESSAGES/django.po
src/locale/pt_BR/LC_MESSAGES/django.mo
No preview for this file type
src/locale/pt_BR/LC_MESSAGES/django.po
... ... @@ -7,7 +7,7 @@ msgid ""
7 7 msgstr ""
8 8 "Project-Id-Version: PACKAGE VERSION\n"
9 9 "Report-Msgid-Bugs-To: \n"
10   -"POT-Creation-Date: 2013-12-06 12:50+0000\n"
  10 +"POT-Creation-Date: 2013-12-06 13:01+0000\n"
11 11 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
12 12 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13 13 "Language-Team: LANGUAGE <LL@li.org>\n"
... ... @@ -754,6 +754,10 @@ msgstr &quot;&quot;
754 754 msgid "Email address verified!"
755 755 msgstr "Endereço de e-mail verificado!"
756 756  
  757 +#: super_archives/management/commands/import_emails.py:205
  758 +msgid "[Colab] Warning - Email sent with a blank subject."
  759 +msgstr "[Colab] Aviso - E-mail enviado com o campo assunto em branco."
  760 +
757 761 #: super_archives/templates/message-preview.html:42
758 762 #: super_archives/templates/message-preview.html:62
759 763 msgid "by"
... ... @@ -832,6 +836,33 @@ msgstr &quot;mais...&quot;
832 836 msgid "most relevant"
833 837 msgstr "mais relevantes"
834 838  
  839 +#: super_archives/templates/superarchives/emails/email_blank_subject.txt:2
  840 +msgid "Hello"
  841 +msgstr "Olá"
  842 +
  843 +#: super_archives/templates/superarchives/emails/email_blank_subject.txt:3
  844 +#, python-format
  845 +msgid ""
  846 +"\n"
  847 +"You've sent an email to %(mailinglist)s with a blank subject and the "
  848 +"following content:\n"
  849 +"\n"
  850 +"\"%(body)s\"\n"
  851 +"\n"
  852 +"Please, fill the subject in every email you send it.\n"
  853 +"\n"
  854 +"Thank you.\n"
  855 +msgstr ""
  856 +"\n"
  857 +"Você enviou um e-mail para %(mailinglist)s com o campo Assunto em branco e "
  858 +"o seguinte conteúdo:\n"
  859 +"\n"
  860 +"\"%(body)s\"\n"
  861 +"\n"
  862 +"Por favor, preencha o assunto em todos os e-mails que você enviar.\n"
  863 +"\n"
  864 +"Obrigado.\n"
  865 +
835 866 #: super_archives/templates/superarchives/emails/email_verification.txt:2
836 867 #, python-format
837 868 msgid ""
... ...
src/super_archives/management/commands/import_emails.py
... ... @@ -11,7 +11,10 @@ from optparse import make_option
11 11  
12 12 from django.db import transaction
13 13 from django.template.defaultfilters import slugify
  14 +from super_archives.utils.message import colab_send_email
14 15 from django.core.management.base import BaseCommand, CommandError
  16 +from django.template.loader import render_to_string
  17 +from django.utils.translation import ugettext as _
15 18  
16 19 from super_archives.models import MailingList, Message, \
17 20 Thread, EmailAddress
... ... @@ -196,6 +199,21 @@ class Command(BaseCommand, object):
196 199 email_addr.save()
197 200  
198 201 subject = email_msg.get_subject()
  202 + if not subject:
  203 + colab_send_email(
  204 + subject=_(
  205 + u"[Colab] Warning - Email sent with a blank subject."
  206 + ),
  207 + message=render_to_string(
  208 + u'superarchives/emails/email_blank_subject.txt',
  209 + {
  210 + 'email_body': email_msg.get_body(),
  211 + 'mailinglist': mailinglist.name,
  212 + 'user': email_addr.get_full_name()
  213 + }
  214 + ),
  215 + to=email_addr.address
  216 + )
199 217  
200 218 email = Message.all_objects.create(
201 219 message_id=email_msg.get('Message-ID'),
... ...
src/super_archives/templates/superarchives/emails/email_blank_subject.txt 0 → 100644
... ... @@ -0,0 +1,11 @@
  1 +{% load i18n %}
  2 +{% trans 'Hello' %} {{ user }},
  3 +{% blocktrans with body=email_body mailinglist=mailinglist %}
  4 +You've sent an email to {{ mailinglist }} with a blank subject and the following content:
  5 +
  6 +"{{ body }}"
  7 +
  8 +Please, fill the subject in every email you send it.
  9 +
  10 +Thank you.
  11 +{% endblocktrans %}
... ...