]> git.parisson.com Git - django-postman.git/commitdiff
Merge branch 'dev' of git+ssh://vcs.parisson.com/var/git/django-postman
authoryomguy <yomguy@parisson.com>
Mon, 24 Sep 2012 12:19:18 +0000 (14:19 +0200)
committeryomguy <yomguy@parisson.com>
Mon, 24 Sep 2012 12:19:18 +0000 (14:19 +0200)
Conflicts:
MANIFEST.in
docs/conf.py
postman/__init__.py
postman/locale/de/LC_MESSAGES/django.po
postman/templates/postman/base.html
postman/templates/postman/base_write.html
postman/test_urls.py
postman/tests.py
postman/utils.py

1  2 
MANIFEST.in
postman/templates/postman/base.html
postman/templates/postman/base_write.html
postman/tests.py
postman/utils.py

diff --cc MANIFEST.in
index 12431ac42c26c1a000f5ca07bf4b0fe03fa0605b,bbdf4a3e4fb949e682a1cec7e7591c73e8eb4100..c3ac1c70924fb222b6079e5bad5b38e033ddce35
@@@ -1,6 -1,6 +1,6 @@@
 -include LICENSE
 +include LICENSE CHANGELOG
  recursive-include postman/locale *.po *.mo
 -recursive-include postman/medias *
 +recursive-include postman/static *
  recursive-include postman/templates *.html *.txt
  graft docs
--prune docs/_build
++prune docs/_build
index 36332119f2215f96e84a2927a0d8d823d9027186,061cf3d7ccdc5e385f02d88b4f2eb8abef97d60c..8f100f83d8d6dfc5222bd3d8ae102a5d0fdd2d7b
@@@ -2,18 -2,12 +2,18 @@@
  {% load url from future %}
  {% load i18n %}{% load postman_tags %}
  {% block title %}{% trans "Messaging" %}{% endblock %}
 +{% block extrahead %}{{ block.super }}
 +<link type="text/css" media="all" rel="stylesheet" href="
 +{# dj v1.4 #}{% load static %}{% static 'postman/css/postman.css' %}
 +{# dj v1.3 #}{# {{ STATIC_URL }}postman/css/postman.css #}
 +{# dj v1.2 #}{# {{ MEDIA_URL }}postman/css/postman.css #}
 +" />{% endblock %}
  {% block postman_menu %}
  <ul id="postman_menu">{% postman_unread as unread_count %}
 - <li><a href="{% url 'postman_inbox' %} ">&raquo;&nbsp;{% trans "Inbox" %}{% if unread_count %} <strong>({{ unread_count }})</strong>{% endif %}</a></li>
 - <li><a href="{% url 'postman_sent' %} ">&raquo;&nbsp;{% trans "Sent Messages" %}</a></li>
 - <li><a href="{% url 'postman_write' %} ">&raquo;&nbsp;{% trans "Write" %}</a></li>
 - <li><a href="{% url 'postman_archives' %} ">&raquo;&nbsp;{% trans "Archives" %}</a></li>
 - <li><a href="{% url 'postman_trash' %} ">&raquo;&nbsp;{% trans "Trash" %}</a></li>
 + <li><a href="{% url 'postman_inbox' %}">&raquo;&nbsp;{% trans "Inbox" %}{% if unread_count %} <strong>({{ unread_count }})</strong>{% endif %}</a></li>
 + <li><a href="{% url 'postman_sent' %}">&raquo;&nbsp;{% trans "Sent Messages" %}</a></li>
 + <li><a href="{% url 'postman_write' %}">&raquo;&nbsp;{% trans "Write" %}</a></li>
 + <li><a href="{% url 'postman_archives' %}">&raquo;&nbsp;{% trans "Archives" %}</a></li>
 + <li><a href="{% url 'postman_trash' %}">&raquo;&nbsp;{% trans "Trash" %}</a></li>
  </ul>
--{% endblock %}
++{% endblock %}
index 86117095cd5c09c9a5a4dfb4d31413c0d89364b9,e188e4821d2c13d5be8e638e5e47fa0907737ba4..a7a3892edf714d3ebac046c5078425ef4981697e
@@@ -33,4 -21,4 +33,4 @@@
  <button type="submit">{% trans "Send" %}</button>
  </form>
  </div>
--{% endblock %}
++{% endblock %}
index 400da375357d67f64b919a92df08704f74c8c0fe,ed96f4c2f69dbdeb938cf2f6d3bf4d93b98ef2fd..c8ffa3e24454495a2dca4974786a1d0e33805f43
@@@ -1295,12 -1295,12 +1295,21 @@@ class MessageTest(BaseTest)
  
      def test_notification_rejection_user(self):
          "Test notify_users() for rejection, sender is a User."
++<<<<<<< HEAD
          m = Message.objects.create(subject='s', moderation_status=STATUS_REJECTED, sender = self.user1, recipient=self.user2)
          self.check_notification(m, 1, self.user1.email, is_auto_moderated=False, notice_label='postman_rejection')
  
      def test_notification_rejection_user_auto_moderated(self):
          "Test notify_users() for rejection, sender is a User, and is alerted online."
          m = Message.objects.create(subject='s', moderation_status=STATUS_REJECTED, sender = self.user1, recipient=self.user2)
++=======
++        m = Message.objects.create(subject='s', moderation_status=STATUS_REJECTED, sender = self.user1, recipient=self.user2)
++        self.check_notification(m, 1, self.user1.email, is_auto_moderated=False, notice_label='postman_rejection')
++
++    def test_notification_rejection_user_auto_moderated(self):
++        "Test notify_users() for rejection, sender is a User, and is alerted online."
++        m = Message.objects.create(subject='s', moderation_status=STATUS_REJECTED, sender = self.user1, recipient=self.user2)
++>>>>>>> dcea2b745ee6fac6ad1721470356616cc4db68fd
          self.check_notification(m, 0, is_auto_moderated=True)
  
      def test_notification_rejection_user_inactive(self):
index d9a2c986fde3fafa3fa180c6f8110ba640acec27,18a2877bd3aa286458896ac75e21341be440ca8f..eeaf998ddc5473c3cc27ddf54793707b1b6c0e61
@@@ -24,11 -24,11 +24,14 @@@ name = getattr(settings, 'POSTMAN_MAILE
  if name and name in settings.INSTALLED_APPS:
      send_mail = __import__(name, globals(), locals(), ['send_mail']).send_mail
  else:
-     from django.core.mail import send_mail
+     from django.core.mail import send_mail, mail_admins
+ # to disable email notification to users
+ DISABLE_USER_EMAILING = getattr(settings, 'POSTMAN_DISABLE_USER_EMAILING', False)
  
 +# to disable email notification to users
 +DISABLE_USER_EMAILING = getattr(settings, 'POSTMAN_DISABLE_USER_EMAILING', False)
 +
  # default wrap width; referenced in forms.py
  WRAP_WIDTH = 55
  
@@@ -88,8 -89,8 +92,9 @@@ def notify_user(object, action)
      else:
          return
      if notification:
 -        notification.send(users=[user], label=label, extra_context={'message': object, 'action': action})
 +        # the context key 'message' is already used in django-notification/models.py/send_now() (v0.2.0)
 +        notification.send(users=[user], label=label, extra_context={'pm_message': object, 'pm_action': action})
      else:
 -        if not DISABLE_USER_EMAILING and user.email:
 -            email('postman/email_user_subject.txt', 'postman/email_user.txt',[user.email], object, action)
 +        if not DISABLE_USER_EMAILING and user.email and user.is_active:
 +            email('postman/email_user_subject.txt', 'postman/email_user.txt', [user.email], object, action)