Commit 267806e3 authored by David Haynes's avatar David Haynes 🙆

API query for specific golinks using the short

- GET /api/golinks/pls
parent 34623c47
Pipeline #2758 passed with stage
in 1 minute
......@@ -12,4 +12,5 @@ from rest_framework import serializers
class URLSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = URL
lookup_field = 'short'
fields = ('destination', 'short', 'date_expires')
......@@ -44,6 +44,7 @@ class URLViewSet(viewsets.ModelViewSet):
"""
serializer_class = URLSerializer
permission_classes = (URLPermission,)
lookup_field = 'short'
def get_queryset(self):
if not self.request.user.is_staff:
......
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