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
b7a13b7c
Commit
b7a13b7c
authored
Sep 09, 2019
by
John Red Medrano
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
alter the value of app_code at current user
parent
47fddd2e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
16 deletions
+26
-16
app/applicationlayer/management/user/serializers.py
app/applicationlayer/management/user/serializers.py
+9
-15
app/entities/migrations/0002_remove_application_app_code.py
app/entities/migrations/0002_remove_application_app_code.py
+17
-0
app/entities/models.py
app/entities/models.py
+0
-1
No files found.
app/applicationlayer/management/user/serializers.py
View file @
b7a13b7c
...
...
@@ -39,27 +39,21 @@ class UserManagementRoleSerializer(serializers.ModelSerializer):
class
UserManagementRetreiveSerializer
(
serializers
.
ModelSerializer
):
image
=
serializers
.
SerializerMethodField
()
applications
=
serializers
.
SerializerMethodField
()
# department_name = serializers.ReadOnlyField(source='department.name')
# department_id = serializers.ReadOnlyField(source='department.id')
department
=
serializers
.
SerializerMethodField
()
company
=
serializers
.
SerializerMethodField
()
# role = UserManagementRoleSerializer()
# special_permissions = serializers.SlugRelatedField(many=True,
# read_only=True,
# slug_field='code')
class
Meta
:
model
=
models
.
User
fields
=
(
'id'
,
'image'
,
'company'
,
'department'
,
'applications'
,
'last_login'
,
'is_superuser'
,
'first_name'
,
'last_name'
,
'is_staff'
,
'is_active'
,
'date_joined'
,
'user_type'
,
'id'
,
'code'
,
'name'
,
'username'
,
'contact_no'
,
'email'
,
'doa'
,
'default_app'
,
'image'
,
'company'
,
'department'
,
'applications'
,
'email'
,
'default_app'
,
'user_type'
,
'is_active'
,
'doa'
,
)
# exclude = ['password', 'application', 'groups', 'user_permissions']
...
...
@@ -92,7 +86,7 @@ class UserManagementRetreiveSerializer(serializers.ModelSerializer):
app
=
user
.
application
.
all
()
list_app
=
[]
for
data
in
app
:
if
user
.
user_type
.
upper
()
==
'USR'
and
data
.
app_code
.
upper
()
==
'RMS'
:
if
user
.
user_type
.
upper
()
==
'USR'
and
data
.
id
==
1
:
pass
else
:
remove
=
[
'Modules'
,
'Companies'
,
'Department'
]
...
...
@@ -118,7 +112,7 @@ class UserManagementRetreiveSerializer(serializers.ModelSerializer):
# list_mod.append(body)
app_body
=
{}
app_body
[
'app_code'
]
=
data
.
app_code
.
lower
()
app_body
[
'app_code'
]
=
data
.
code
app_body
[
'name'
]
=
data
.
name
app_body
[
'modules'
]
=
mod
list_app
.
append
(
app_body
)
...
...
app/entities/migrations/0002_remove_application_app_code.py
0 → 100644
View file @
b7a13b7c
# Generated by Django 2.2 on 2019-09-09 17:14
from
django.db
import
migrations
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'entities'
,
'0001_initial'
),
]
operations
=
[
migrations
.
RemoveField
(
model_name
=
'application'
,
name
=
'app_code'
,
),
]
app/entities/models.py
View file @
b7a13b7c
...
...
@@ -26,7 +26,6 @@ class Application(AuditClass):
max_length
=
255
)
name
=
models
.
CharField
(
unique
=
True
,
max_length
=
255
)
app_code
=
models
.
CharField
(
max_length
=
255
)
class
Meta
:
db_table
=
'applications'
...
...
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