Fix bug
This commit is contained in:
parent
6e6b247bf9
commit
81d6a57b26
1 changed files with 2 additions and 1 deletions
|
@ -15,6 +15,7 @@ from django.http import (
|
||||||
HttpResponseRedirect,
|
HttpResponseRedirect,
|
||||||
HttpResponseBadRequest,
|
HttpResponseBadRequest,
|
||||||
)
|
)
|
||||||
|
from django.shortcuts import get_object_or_404
|
||||||
from django.urls import reverse
|
from django.urls import reverse
|
||||||
from django.utils import timezone
|
from django.utils import timezone
|
||||||
from django.utils.safestring import mark_safe
|
from django.utils.safestring import mark_safe
|
||||||
|
@ -120,7 +121,7 @@ class OrganizationMixin(OrganizationBase):
|
||||||
def dispatch(self, request, *args, **kwargs):
|
def dispatch(self, request, *args, **kwargs):
|
||||||
try:
|
try:
|
||||||
self.organization_id = int(kwargs["pk"])
|
self.organization_id = int(kwargs["pk"])
|
||||||
self.organization = Organization.objects.get(id=self.organization_id)
|
self.organization = get_object_or_404(Organization, id=self.organization_id)
|
||||||
except Http404:
|
except Http404:
|
||||||
key = kwargs.get(self.slug_url_kwarg, None)
|
key = kwargs.get(self.slug_url_kwarg, None)
|
||||||
if key:
|
if key:
|
||||||
|
|
Loading…
Add table
Reference in a new issue