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
f78354cc
Commit
f78354cc
authored
Sep 13, 2019
by
John Red Medrano
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modify company and department value to instance value
parent
0c37650e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
app/applicationlayer/management/account/serializer.py
app/applicationlayer/management/account/serializer.py
+3
-3
No files found.
app/applicationlayer/management/account/serializer.py
View file @
f78354cc
...
...
@@ -4,6 +4,7 @@ import ast
from
django.contrib.auth.hashers
import
make_password
,
check_password
import
re
from
django.contrib.auth
import
authenticate
from
django.forms.models
import
model_to_dict
class
UserSerializer
(
serializers
.
ModelSerializer
):
...
...
@@ -19,8 +20,8 @@ class UserSerializer(serializers.ModelSerializer):
# ).values().first()
ret
=
super
()
.
to_representation
(
instance
)
ret
[
'department
_name'
]
=
instance
.
department
.
name
ret
[
'company
_name'
]
=
instance
.
department
.
company
.
name
ret
[
'department
'
]
=
model_to_dict
(
instance
.
department
)
ret
[
'company
'
]
=
model_to_dict
(
instance
.
department
.
company
)
return
ret
class
Meta
:
...
...
@@ -29,7 +30,6 @@ class UserSerializer(serializers.ModelSerializer):
'id'
,
'code'
,
'name'
,
'username'
,
'contact_no'
,
'department'
,
'email'
,
'default_app'
,
'user_type'
,
'is_active'
,
'doa'
...
...
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