Skip to content

Commit

Permalink
Don't use hardcoded urls and status
Browse files Browse the repository at this point in the history
  • Loading branch information
MoisesGSalas committed Feb 9, 2021
1 parent b22cdb4 commit 7efbc77
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 4 additions & 4 deletions eox_tagging/api/v1/viewset.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"""
from edx_api_doc_tools import query_parameter, schema_for
from eox_audit_model.decorators import audit_method
from rest_framework import viewsets
from rest_framework import status, viewsets
from rest_framework.authentication import SessionAuthentication

from eox_tagging.api.v1.filters import FilterBackend, TagFilter
Expand Down Expand Up @@ -72,14 +72,14 @@
"""
Delete single tag by key. Deleted tags are inactivated (soft delete)
""",
responses={404: "Not found"},
responses={status.HTTP_404_NOT_FOUND: "Not found"},
)
@schema_for(
"retrieve",
"""
Fetch details for a single tag by key
""",
responses={404: "Not found"},
responses={status.HTTP_404_NOT_FOUND: "Not found"},
)
@schema_for(
"list",
Expand Down Expand Up @@ -172,7 +172,7 @@
),
query_parameter("access", str, "Filter by access, One of `PUBLIC`, `PRIVATE`, `PROTECTED`"),
],
responses={404: "Not found"},
responses={status.HTTP_404_NOT_FOUND: "Not found"},
)
class TagViewSet(viewsets.ModelViewSet):
"""Viewset for listing and creating Tags."""
Expand Down
3 changes: 2 additions & 1 deletion eox_tagging/api_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"""
from django.conf import settings
from django.conf.urls import include, url
from django.urls import reverse
from drf_yasg.generators import OpenAPISchemaGenerator
from drf_yasg.openapi import SwaggerDict
from drf_yasg.views import get_schema_view
Expand All @@ -22,7 +23,7 @@ def get_security_definitions(self):
security_definitions = {
"OAuth2": {
"flow": "application",
"tokenUrl": "{}/oauth2/access_token/".format(settings.LMS_ROOT_URL),
"tokenUrl": "{}{}".format(settings.LMS_ROOT_URL, reverse('access_token')),
"type": "oauth2",
},
}
Expand Down

0 comments on commit 7efbc77

Please sign in to comment.