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
09558182
Commit
09558182
authored
Sep 13, 2019
by
John Red Medrano
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add department name and company name at user list
parent
dab586ce
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
5 deletions
+20
-5
app/applicationlayer/management/account/serializer.py
app/applicationlayer/management/account/serializer.py
+18
-3
app/applicationlayer/management/user/serializers.py
app/applicationlayer/management/user/serializers.py
+1
-1
env.template.ini
env.template.ini
+1
-1
No files found.
app/applicationlayer/management/account/serializer.py
View file @
09558182
from
rest_framework
import
serializers
from
app.entities.models
import
User
from
app.entities.models
import
User
,
Department
import
ast
from
django.contrib.auth.hashers
import
make_password
,
check_password
import
re
...
...
@@ -7,6 +7,22 @@ from django.contrib.auth import authenticate
class
UserSerializer
(
serializers
.
ModelSerializer
):
def
to_representation
(
self
,
instance
):
# department = Department.objects.filter(
# id=instance.company.id
# ).values().first()
# company_name = Department.objects.filter(
# id=instance.company.id
# ).values().first()
ret
=
super
()
.
to_representation
(
instance
)
ret
[
'department_name'
]
=
instance
.
department
.
name
ret
[
'company_name'
]
=
instance
.
department
.
company
.
name
return
ret
class
Meta
:
model
=
User
fields
=
(
...
...
@@ -16,8 +32,7 @@ class UserSerializer(serializers.ModelSerializer):
'department'
,
'email'
,
'default_app'
,
'user_type'
,
'is_active'
,
'doa'
,
# 'password',
'doa'
)
...
...
app/applicationlayer/management/user/serializers.py
View file @
09558182
...
...
@@ -53,7 +53,6 @@ class UserManagementRetreiveSerializer(serializers.ModelSerializer):
'email'
,
'default_app'
,
'user_type'
,
'is_active'
,
'doa'
,
)
# exclude = ['password', 'application', 'groups', 'user_permissions']
...
...
@@ -97,6 +96,7 @@ class UserManagementRetreiveSerializer(serializers.ModelSerializer):
if
user
.
user_type
==
'SU'
:
mod
=
data
.
modules
.
all
()
.
values
()
remove
=
[]
elif
user
.
user_type
==
'OUA'
:
remove
.
remove
(
"Department Management"
)
remove
.
remove
(
"User Management"
)
...
...
env.template.ini
View file @
09558182
...
...
@@ -63,4 +63,4 @@ VENDOR_ACCEPTANCE_MESSAGE = has ACCEPTED the change request;RMS-CRACCEPTED
VENDOR_REJECT_MESSAGE
=
has REJECTED the change request;RMS-CRREJECTED-VENDOR
[ADMIN]
CATCH_EMAIL
=
'red@tirsolutions.com'
CATCH_EMAIL
=
red@tirsolutions.com
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