Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ Add `pinax.notifications.urls` to your project urlpatterns:
```python
urlpatterns = [
# other urls
url(r"^notifications/", include("pinax.notifications.urls", namespace="pinax_notifications")),
re_path(r"^notifications/", include("pinax.notifications.urls", namespace="pinax_notifications")),
]
```

Expand Down Expand Up @@ -139,7 +139,7 @@ One way to create notice types is using a custom `AppConfig`. Here is an example
# myapp/signals/handlers.py

from django.conf import settings
from django.utils.translation import ugettext_noop as _
from django.utils.translation import gettext_noop as _

def create_notice_types(sender, **kwargs):
if "pinax.notifications" in settings.INSTALLED_APPS:
Expand All @@ -155,7 +155,7 @@ Notice that the code is wrapped in a conditional clause so if
`pinax-notifications` is not installed, your app will proceed anyway.

Note that the display and description arguments are marked for translation by
using ugettext_noop. That will enable you to use Django's makemessages
using gettext_noop. That will enable you to use Django's makemessages
management command and use `pinax-notifications` i18n capabilities.

```python
Expand Down Expand Up @@ -472,14 +472,14 @@ Then override the url:
```python
# urls.py

from django.conf.urls import url
from django.urls import re_path

from .views import TeamNoticeSettingsView


urlpatterns = [
# other urls
url(r"^notifications/settings/$", TeamNoticeSettingsView.as_view(), name="notification_notice_settings"),
re_path(r"^notifications/settings/$", TeamNoticeSettingsView.as_view(), name="notification_notice_settings"),
]
```

Expand Down
2 changes: 1 addition & 1 deletion pinax/notifications/apps.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from django.apps import AppConfig as BaseAppConfig
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _


class AppConfig(BaseAppConfig):
Expand Down
4 changes: 2 additions & 2 deletions pinax/notifications/backends/email.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from django.conf import settings
from django.core.mail import send_mail
from django.template.loader import render_to_string
from django.utils.translation import ugettext
from django.utils.translation import gettext

from .base import BaseBackend

Expand All @@ -22,7 +22,7 @@ def deliver(self, recipient, sender, notice_type, extra_context):
context.update({
"recipient": recipient,
"sender": sender,
"notice": ugettext(notice_type.display),
"notice": gettext(notice_type.display),
})
context.update(extra_context)

Expand Down
2 changes: 1 addition & 1 deletion pinax/notifications/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from django.db import models
from django.db.models.query import QuerySet
from django.utils.translation import activate, get_language
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from .conf import settings
from .hooks import hookset
Expand Down
4 changes: 2 additions & 2 deletions pinax/notifications/tests/urls.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from django.conf.urls import include, url
from django.urls import include, re_path

urlpatterns = [
url(r"^notifications/", include("pinax.notifications.urls", namespace="pinax_notifications")),
re_path(r"^notifications/", include("pinax.notifications.urls", namespace="pinax_notifications")),
]
4 changes: 2 additions & 2 deletions pinax/notifications/urls.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from django.conf.urls import url
from django.urls import re_path

from .views import NoticeSettingsView

app_name = "pinax_notifications"

urlpatterns = [
url(r"^settings/$", NoticeSettingsView.as_view(), name="notice_settings"),
re_path(r"^settings/$", NoticeSettingsView.as_view(), name="notice_settings"),
]