Skip to content

Commit

Permalink
Merge pull request #169 from gyana/patch-1
Browse files Browse the repository at this point in the history
Update import for django 4.0
  • Loading branch information
valberg authored Mar 30, 2022
2 parents 966b855 + 141b878 commit 4aec98d
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 12 deletions.
7 changes: 5 additions & 2 deletions invitations/adapters.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,12 @@
from .utils import import_attribute

try:
from django.utils.encoding import force_text
from django.utils.encoding import force_str as force_text
except ImportError:
from django.utils.encoding import force_unicode as force_text
try:
from django.utils.encoding import force_text
except ImportError:
from django.utils.encoding import force_unicode as force_text


# Code credits here to django-allauth
Expand Down
2 changes: 1 addition & 1 deletion invitations/base_invitation.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from django.conf import settings
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from .managers import BaseInvitationManager

Expand Down
2 changes: 1 addition & 1 deletion invitations/forms.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from django import forms
from django.contrib.auth import get_user_model
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from .adapters import get_invitations_adapter
from .exceptions import AlreadyAccepted, AlreadyInvited, UserRegisteredEmail
Expand Down
2 changes: 1 addition & 1 deletion invitations/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from django.db import models
from django.utils import timezone
from django.utils.crypto import get_random_string
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from . import signals
from .adapters import get_invitations_adapter
Expand Down
4 changes: 2 additions & 2 deletions invitations/signals.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from django.dispatch import Signal

invite_url_sent = Signal(providing_args=['invite_url_sent', 'inviter'])
invite_accepted = Signal(providing_args=['email'])
invite_url_sent = Signal()
invite_accepted = Signal()

"""
@receiver(invite_url_sent, sender=Invitation)
Expand Down
8 changes: 4 additions & 4 deletions invitations/urls.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
from django.conf.urls import url
from django.urls import re_path

from . import views

app_name = 'invitations'
urlpatterns = [
url(r'^send-invite/$', views.SendInvite.as_view(),
re_path(r'^send-invite/$', views.SendInvite.as_view(),
name='send-invite'),

url(r'^send-json-invite/$', views.SendJSONInvite.as_view(),
re_path(r'^send-json-invite/$', views.SendJSONInvite.as_view(),
name='send-json-invite'),

url(r'^accept-invite/(?P<key>\w+)/?$', views.AcceptInvite.as_view(),
re_path(r'^accept-invite/(?P<key>\w+)/?$', views.AcceptInvite.as_view(),
name='accept-invite'),
]
2 changes: 1 addition & 1 deletion invitations/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from django.http import Http404, HttpResponse
from django.shortcuts import redirect
from django.utils.decorators import method_decorator
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _
from django.views.generic import FormView, View
from django.views.generic.detail import SingleObjectMixin

Expand Down

0 comments on commit 4aec98d

Please sign in to comment.