From 8de4caa2a3b085d71758556890120fc598ec461a Mon Sep 17 00:00:00 2001 From: Jose Antonio Martin Date: Fri, 12 May 2017 13:13:49 +0200 Subject: [PATCH] import 'pinax.notifications' instead of 'notification' (fixes issue #90) --- README.rst | 6 +++--- django_messages/admin.py | 4 ++-- django_messages/forms.py | 4 ++-- django_messages/management.py | 4 ++-- django_messages/models.py | 2 +- django_messages/views.py | 4 ++-- docs/customizing.txt | 2 +- docs/install.txt | 4 ++-- docs/usage.txt | 2 +- 9 files changed, 16 insertions(+), 16 deletions(-) diff --git a/README.rst b/README.rst index ab79baa..fa9ffaf 100644 --- a/README.rst +++ b/README.rst @@ -78,9 +78,9 @@ Dependencies ------------ Django-messages has no external dependencies except for django. However, if -django-notification and/or django-mailer are found, it will make use of them. -Note: as of r65 django-messages will only use django-notification if -'notification' is also added to the INSTALLED_APPS setting. This has been +pinax-notifications and/or django-mailer are found, it will make use of them. +Note: as of r65 django-messages will only use pinax-notifications if +'pinax.notifications' is also added to the INSTALLED_APPS setting. This has been done to make situations possible where notification is on pythonpath but should not be used, or where notification is another python package, such as django-notification which has the same name. diff --git a/django_messages/admin.py b/django_messages/admin.py index 51c493c..60c6044 100644 --- a/django_messages/admin.py +++ b/django_messages/admin.py @@ -7,8 +7,8 @@ from django_messages.utils import get_user_model User = get_user_model() -if "notification" in settings.INSTALLED_APPS and getattr(settings, 'DJANGO_MESSAGES_NOTIFY', True): - from notification import models as notification +if "pinax.notifications" in settings.INSTALLED_APPS and getattr(settings, 'DJANGO_MESSAGES_NOTIFY', True): + from pinax.notifications import models as notification else: notification = None diff --git a/django_messages/forms.py b/django_messages/forms.py index 1e81d4b..79a0238 100644 --- a/django_messages/forms.py +++ b/django_messages/forms.py @@ -3,8 +3,8 @@ from django.utils.translation import ugettext_lazy as _ from django.utils import timezone -if "notification" in settings.INSTALLED_APPS and getattr(settings, 'DJANGO_MESSAGES_NOTIFY', True): - from notification import models as notification +if "pinax.notifications" in settings.INSTALLED_APPS and getattr(settings, 'DJANGO_MESSAGES_NOTIFY', True): + from pinax.notifications import models as notification else: notification = None diff --git a/django_messages/management.py b/django_messages/management.py index 2172a0f..cac6178 100644 --- a/django_messages/management.py +++ b/django_messages/management.py @@ -2,8 +2,8 @@ from django.conf import settings from django.utils.translation import ugettext_noop as _ -if "notification" in settings.INSTALLED_APPS and getattr(settings, 'DJANGO_MESSAGES_NOTIFY', True): - from notification import models as notification +if "pinax.notifications" in settings.INSTALLED_APPS and getattr(settings, 'DJANGO_MESSAGES_NOTIFY', True): + from pinax.notifications import models as notification def create_notice_types(app, created_models, verbosity, **kwargs): notification.create_notice_type("messages_received", _("Message Received"), _("you have received a message"), default=2) diff --git a/django_messages/models.py b/django_messages/models.py index d627916..47924fc 100644 --- a/django_messages/models.py +++ b/django_messages/models.py @@ -100,6 +100,6 @@ def inbox_count_for(user): return Message.objects.filter(recipient=user, read_at__isnull=True, recipient_deleted_at__isnull=True).count() # fallback for email notification if django-notification could not be found -if "notification" not in settings.INSTALLED_APPS and getattr(settings, 'DJANGO_MESSAGES_NOTIFY', True): +if "pinax.notifications" not in settings.INSTALLED_APPS and getattr(settings, 'DJANGO_MESSAGES_NOTIFY', True): from django_messages.utils import new_message_email signals.post_save.connect(new_message_email, sender=Message) diff --git a/django_messages/views.py b/django_messages/views.py index 21ad602..5998f04 100644 --- a/django_messages/views.py +++ b/django_messages/views.py @@ -14,8 +14,8 @@ User = get_user_model() -if "notification" in settings.INSTALLED_APPS and getattr(settings, 'DJANGO_MESSAGES_NOTIFY', True): - from notification import models as notification +if "pinax.notifications" in settings.INSTALLED_APPS and getattr(settings, 'DJANGO_MESSAGES_NOTIFY', True): + from pinax.notifications import models as notification else: notification = None diff --git a/docs/customizing.txt b/docs/customizing.txt index 111a151..36a2b65 100644 --- a/docs/customizing.txt +++ b/docs/customizing.txt @@ -33,7 +33,7 @@ Django-messages uses the following templates: * :file:`django_messages/view.html` - This template renders a single message with all details. -Additionally django-message provides a set of template for django-notification. +Additionally django-message provides a set of template for pinax-notifications. These template can be found in :file:`django_messages/templates/notification/` and can also be overwritten in one of your project's ``TEMPLATE_DIRS``. diff --git a/docs/install.txt b/docs/install.txt index 7a44a86..2c5112a 100644 --- a/docs/install.txt +++ b/docs/install.txt @@ -74,7 +74,7 @@ Django-messages has some features which may use an external app if it is present in the current Django project. Please note, that these apps have to be listed in ``INSTALLED_APPS`` to be used by django-messages. -* If you use `django-notification`_ django-messages will use it for sending +* If you use `pinax-notifications`_ django-messages will use it for sending notifications to users about new messages instead of using the built-in mechanism @@ -86,5 +86,5 @@ on Python 2.5 sometimes code might slip in which breaks Python 2.4 compatibility This can be considered a bug and you can help us by reporting the incompytibility. -.. _`django-notification`: http://code.google.com/p/django-notification/ +.. _`pinax-notifications`: https://github.com/pinax/pinax-notifications .. _`django-mailer`: http://code.google.com/p/django-mailer/ diff --git a/docs/usage.txt b/docs/usage.txt index 00989a6..7e4405c 100644 --- a/docs/usage.txt +++ b/docs/usage.txt @@ -91,7 +91,7 @@ Settings Options ---------------- If you do want to disable django-messages from sending either a -'django-notification' notice or an email (fallback if 'django-notification +'pinax-notifications' notice or an email (fallback if 'pinax-notifications not installed' then set the following in your django settings:: DJANGO_MESSAGES_NOTIFY = False