Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SRCT
go
Commits
267806e3
Commit
267806e3
authored
Jul 29, 2018
by
David Haynes
🙆
Browse files
API query for specific golinks using the short
- GET /api/golinks/pls
parent
34623c47
Pipeline
#2758
passed with stage
in 1 minute
Changes
2
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
go/go/serializers.py
View file @
267806e3
...
...
@@ -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'
)
go/go/views.py
View file @
267806e3
...
...
@@ -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
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment