Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

resolve django3.2 deprecation issues #104

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
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
4 changes: 3 additions & 1 deletion pinax/notifications/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import pkg_resources
import django

default_app_config = "pinax.notifications.apps.AppConfig"
if django.VERSION < (3, 2):
default_app_config = "pinax.notifications.apps.AppConfig"
__version__ = pkg_resources.get_distribution("pinax-notifications").version
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, path

urlpatterns = [
url(r"^notifications/", include("pinax.notifications.urls", namespace="pinax_notifications")),
path("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 path

from .views import NoticeSettingsView

app_name = "pinax_notifications"

urlpatterns = [
url(r"^settings/$", NoticeSettingsView.as_view(), name="notice_settings"),
path("settings/", NoticeSettingsView.as_view(), name="notice_settings"),
]
3 changes: 2 additions & 1 deletion runtests.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@
],
},
},
]
],
DEFAULT_AUTO_FIELD='django.db.models.BigAutoField',
)


Expand Down
4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ show_missing = True
[tox]
envlist =
checkqa,
py{36,37,38}-dj{22,30}
py{37,38,39}-dj{22,32}

[testenv]
passenv = CI CIRCLECI CIRCLE_*
deps =
coverage<5
codecov
dj22: Django>=2.2,<3.0
dj30: Django>=3.0,<3.1
dj32: Django>=3.2,<3.3
master: https://github.com/django/django/tarball/master

usedevelop = True
Expand Down