Commit e0173e2f authored by Okhin's avatar Okhin
Browse files

Update plugins and fix the decorators name for DRF and the way urlpattern are now loaded

parent 2314060a
from django_fsm import has_transition_perm, can_proceed from django_fsm import has_transition_perm, can_proceed
from rest_framework.decorators import detail_route from rest_framework.decorators import action
from rest_framework.exceptions import PermissionDenied from rest_framework.exceptions import PermissionDenied
from rest_framework.response import Response from rest_framework.response import Response
...@@ -7,7 +7,7 @@ import inspect ...@@ -7,7 +7,7 @@ import inspect
def get_transition_viewset_method(model, transition_name): def get_transition_viewset_method(model, transition_name):
@detail_route(methods=['post']) @action(methods=['post'], detail=True)
def inner_func(self, request, pk=None, *args, **kwargs): def inner_func(self, request, pk=None, *args, **kwargs):
object = self.get_object() object = self.get_object()
transition_method = getattr(object, transition_name) transition_method = getattr(object, transition_name)
......
...@@ -22,11 +22,11 @@ urlpatterns = [ ...@@ -22,11 +22,11 @@ urlpatterns = [
url(r"^admin/", admin.site.urls), url(r"^admin/", admin.site.urls),
url(r'^i18n/', include('django.conf.urls.i18n')), url(r'^i18n/', include('django.conf.urls.i18n')),
url(r"^api/", include(router.urls, namespace="api")), url(r"^api/", include((router.urls, "api"))),
url(r"^feeds/", include("rp.feeds.urls", namespace="feeds")), url(r"^feeds/", include(("rp.feeds.urls", "feeds"))),
url(r"^rp/", include("rp.urls", namespace="rp")), url(r"^rp/", include(("rp.urls", "rp"))),
url(r'^accounts/', include('allauth.urls')), url(r'^accounts/', include('allauth.urls')),
url(r"^users/", include('userprofile.urls', namespace="users")), url(r"^users/", include(('userprofile.urls', "users"))),
url(r"^docs/api/", include_docs_urls(title="API de la revue de presse")), url(r"^docs/api/", include_docs_urls(title="API de la revue de presse")),
] ]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment