Commit d546bdff authored by Virgílio Nascimento Santos's avatar Virgílio Nascimento Santos
Browse files

users: hide /me url

parent 1163ad4c
...@@ -7,8 +7,8 @@ from django.conf.urls import url ...@@ -7,8 +7,8 @@ from django.conf.urls import url
from . import views from . import views
router = SimpleRouter() router = SimpleRouter()
router.register(r'', views.UserViewSet), router.register(r'', views.UserViewSet)
router.register(r'^me/$', views.UserViewSet.as_view({'get': 'retrieve'}), base_name='me'), # router.register(r'^me/$', views.UserViewSet, base_name='me')
urlpatterns = [ urlpatterns = [
url( url(
......
...@@ -47,7 +47,7 @@ class UserViewSet(ModelViewSet): ...@@ -47,7 +47,7 @@ class UserViewSet(ModelViewSet):
else: else:
return Response(status=status.HTTP_400_BAD_REQUEST) return Response(status=status.HTTP_400_BAD_REQUEST)
def retrieve(self, request, pk=None): def retrieve(self, request, *args, **kwargs):
if self.request.user.id is None: if self.request.user.id is None:
raise Http404 raise Http404
......
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