Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
R
red-ci-cd
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
red-group-test
red-ci-cd
Commits
61861cb9
Commit
61861cb9
authored
May 31, 2019
by
John Red Medrano
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removed unused codes
parent
a9844ae2
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
24 additions
and
33 deletions
+24
-33
api/urls.py
api/urls.py
+1
-1
api/utils.py
api/utils.py
+0
-1
api/viewsets/applications.py
api/viewsets/applications.py
+0
-9
api/viewsets/endpoints.py
api/viewsets/endpoints.py
+14
-12
api/viewsets/services.py
api/viewsets/services.py
+9
-10
No files found.
api/urls.py
View file @
61861cb9
...
@@ -10,7 +10,7 @@ from api.views import (
...
@@ -10,7 +10,7 @@ from api.views import (
router
=
DefaultRouter
()
router
=
DefaultRouter
()
router
.
register
(
r'applications'
,
ApplicationViewSet
)
router
.
register
(
r'applications'
,
ApplicationViewSet
)
router
.
register
(
r'services'
,
APIServiceViewSet
)
router
.
register
(
r'services'
,
APIServiceViewSet
)
router
.
register
(
r'endpoint'
,
APIEndpointViewSet
)
router
.
register
(
r'endpoint
s
'
,
APIEndpointViewSet
)
router
.
register
(
r'main-application'
,
MainApplicationViewSet
)
router
.
register
(
r'main-application'
,
MainApplicationViewSet
)
urlpatterns
=
[
urlpatterns
=
[
...
...
api/utils.py
View file @
61861cb9
...
@@ -9,7 +9,6 @@ from .models import APIEndpoint
...
@@ -9,7 +9,6 @@ from .models import APIEndpoint
from
rest_framework.pagination
import
PageNumberPagination
from
rest_framework.pagination
import
PageNumberPagination
from
rest_framework.response
import
Response
from
rest_framework.response
import
Response
import
datetime
import
datetime
from
functools
import
wraps
VALIDATE_TOKEN_URL
=
settings
.
VALIDATE_TOKEN_URL
VALIDATE_TOKEN_URL
=
settings
.
VALIDATE_TOKEN_URL
...
...
api/viewsets/applications.py
View file @
61861cb9
...
@@ -246,12 +246,3 @@ class ApplicationViewSet(viewsets.ModelViewSet):
...
@@ -246,12 +246,3 @@ class ApplicationViewSet(viewsets.ModelViewSet):
class
MainApplicationViewSet
(
viewsets
.
ModelViewSet
):
class
MainApplicationViewSet
(
viewsets
.
ModelViewSet
):
queryset
=
Application
.
objects
.
all
()
queryset
=
Application
.
objects
.
all
()
serializer_class
=
GroupDependentSerializer
serializer_class
=
GroupDependentSerializer
# def get_queryset(self):
# groups = self.request.query_params.get(
# 'groups', None
# )
# groups = groups.split(',')
# # print()
# app = Application.objects.filter(id__in=groups)
# return app
api/viewsets/endpoints.py
View file @
61861cb9
...
@@ -3,7 +3,10 @@ from rest_framework.decorators import action
...
@@ -3,7 +3,10 @@ from rest_framework.decorators import action
from
rest_framework.response
import
Response
from
rest_framework.response
import
Response
from
api.models
import
APIEndpoint
from
api.models
import
APIEndpoint
from
api.serializers
import
APIEndpointSerializer
from
api.serializers
import
APIEndpointSerializer
from
api.utils
import
(
APIEndpointFilter
,
CustomPagination
,
BadRequestException
,
status_message_response
)
from
api.utils
import
(
APIEndpointFilter
,
CustomPagination
,
BadRequestException
,
status_message_response
)
from
django_filters.rest_framework
import
DjangoFilterBackend
from
django_filters.rest_framework
import
DjangoFilterBackend
...
@@ -24,7 +27,6 @@ class APIEndpointViewSet(viewsets.ModelViewSet):
...
@@ -24,7 +27,6 @@ class APIEndpointViewSet(viewsets.ModelViewSet):
serializer
=
self
.
get_serializer
(
data
=
request
.
data
)
serializer
=
self
.
get_serializer
(
data
=
request
.
data
)
serializer
.
is_valid
(
raise_exception
=
True
)
serializer
.
is_valid
(
raise_exception
=
True
)
self
.
perform_create
(
serializer
)
self
.
perform_create
(
serializer
)
headers
=
self
.
get_success_headers
(
serializer
.
data
)
message
=
status_message_response
(
201
,
'success'
,
'New endpoint created'
,
serializer
.
data
)
message
=
status_message_response
(
201
,
'success'
,
'New endpoint created'
,
serializer
.
data
)
return
Response
(
message
)
return
Response
(
message
)
...
...
api/viewsets/services.py
View file @
61861cb9
...
@@ -21,7 +21,6 @@ class APIServiceViewSet(viewsets.ModelViewSet):
...
@@ -21,7 +21,6 @@ class APIServiceViewSet(viewsets.ModelViewSet):
serializer
=
self
.
get_serializer
(
data
=
request
.
data
)
serializer
=
self
.
get_serializer
(
data
=
request
.
data
)
serializer
.
is_valid
(
raise_exception
=
True
)
serializer
.
is_valid
(
raise_exception
=
True
)
self
.
perform_create
(
serializer
)
self
.
perform_create
(
serializer
)
headers
=
self
.
get_success_headers
(
serializer
.
data
)
message
=
status_message_response
(
201
,
'success'
,
'New service created'
,
serializer
.
data
)
message
=
status_message_response
(
201
,
'success'
,
'New service created'
,
serializer
.
data
)
return
Response
(
message
)
return
Response
(
message
)
...
...
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