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
95dc2296
Commit
95dc2296
authored
Sep 23, 2019
by
John Red Medrano
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixing
parent
fac20362
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
2 deletions
+3
-2
app/applicationlayer/management/account/serializer.py
app/applicationlayer/management/account/serializer.py
+2
-0
app/applicationlayer/management/account/views.py
app/applicationlayer/management/account/views.py
+1
-2
No files found.
app/applicationlayer/management/account/serializer.py
View file @
95dc2296
...
@@ -13,7 +13,9 @@ class UserSerializer(serializers.ModelSerializer):
...
@@ -13,7 +13,9 @@ class UserSerializer(serializers.ModelSerializer):
def
to_representation
(
self
,
instance
):
def
to_representation
(
self
,
instance
):
ret
=
super
()
.
to_representation
(
instance
)
ret
=
super
()
.
to_representation
(
instance
)
get_code
=
User
.
objects
.
get
(
id
=
instance
.
id
)
ret
[
'department'
]
=
model_to_dict
(
instance
.
department
)
ret
[
'department'
]
=
model_to_dict
(
instance
.
department
)
ret
[
'code'
]
=
str
(
get_code
.
code
)
ret
[
'company'
]
=
model_to_dict
(
instance
.
department
.
company
)
ret
[
'company'
]
=
model_to_dict
(
instance
.
department
.
company
)
application
=
instance
.
application
.
values
()
application
=
instance
.
application
.
values
()
ret
[
'application'
]
=
application
ret
[
'application'
]
=
application
...
...
app/applicationlayer/management/account/views.py
View file @
95dc2296
...
@@ -27,7 +27,7 @@ from rest_framework.exceptions import ParseError
...
@@ -27,7 +27,7 @@ from rest_framework.exceptions import ParseError
class
UserViewSet
(
viewsets
.
ModelViewSet
):
class
UserViewSet
(
viewsets
.
ModelViewSet
):
queryset
=
User
.
objects
.
all
()
.
order_by
(
'-
create
d'
)
queryset
=
User
.
objects
.
all
()
.
order_by
(
'-
i
d'
)
serializer_class
=
serializer
.
UserSerializer
serializer_class
=
serializer
.
UserSerializer
pagination_class
=
CustomPagination
pagination_class
=
CustomPagination
lookup_field
=
'code'
lookup_field
=
'code'
...
@@ -77,7 +77,6 @@ class UserViewSet(viewsets.ModelViewSet):
...
@@ -77,7 +77,6 @@ class UserViewSet(viewsets.ModelViewSet):
id
=
serializer
.
data
[
'id'
]
id
=
serializer
.
data
[
'id'
]
)
.
update
(
password
=
password_hash
)
)
.
update
(
password
=
password_hash
)
message
=
status_message_response
(
message
=
status_message_response
(
201
,
'success'
,
201
,
'success'
,
'New Users created'
,
serializer
.
data
'New Users created'
,
serializer
.
data
...
...
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