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
43f72c72
Commit
43f72c72
authored
Sep 20, 2019
by
Gladys Forte
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'RMSv2' of
http://42.61.118.105:7990/scm/rms/api-main-service
into gladys-dev2
parents
7f118c84
9d8d89af
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
12 deletions
+29
-12
app/applicationlayer/management/account/views.py
app/applicationlayer/management/account/views.py
+11
-1
app/applicationlayer/management/user/serializers.py
app/applicationlayer/management/user/serializers.py
+7
-6
app/applicationlayer/master/user_type/views.py
app/applicationlayer/master/user_type/views.py
+11
-5
No files found.
app/applicationlayer/management/account/views.py
View file @
43f72c72
...
...
@@ -52,8 +52,18 @@ class UserViewSet(viewsets.ModelViewSet):
password
=
User
.
objects
.
make_random_password
(
length
=
10
)
password_hash
=
make_password
(
password
)
app
=
request
.
data
[
'application'
]
if
request
.
data
[
'user_type'
]
!=
'USR'
:
rms
=
Application
.
objects
.
filter
(
id
=
1
)
.
values
(
'code'
)
.
first
()
app
.
append
(
rms
[
'code'
])
# else:
# app = request.data['application']
app
=
Application
.
objects
.
filter
(
code__in
=
request
.
data
[
'application'
]
code__in
=
app
)
instance
=
User
.
objects
.
get
(
...
...
app/applicationlayer/management/user/serializers.py
View file @
43f72c72
...
...
@@ -94,8 +94,6 @@ class UserManagementRetreiveSerializer(serializers.ModelSerializer):
rms
=
models
.
Application
.
objects
.
filter
(
id
=
1
)
.
values
()
.
first
()
for
data
in
app
:
# print(user.user_type.upper())
# print(data.id)
if
data
.
id
==
1
:
if
user
.
user_type
.
upper
()
==
enums
.
UserTypeEnum
.
SUPER_USER
.
value
:
rms_module
=
models
.
Module
.
objects
.
filter
(
...
...
@@ -106,12 +104,15 @@ class UserManagementRetreiveSerializer(serializers.ModelSerializer):
rms_module
=
models
.
Module
.
objects
.
filter
(
code
=
"MODULE-20190919-0000006"
)
# else:
# rms_module= ''
else
:
rms_module
=
data
.
modules
.
all
()
# mod = mod.order_by('parent', 'sort_id')
mod
=
ModuleSerializer
(
data
=
rms_module
,
many
=
True
)
if
user
.
user_type
.
upper
()
!=
enums
.
UserTypeEnum
.
USER
.
value
:
rms_module2
=
models
.
Module
.
objects
.
filter
(
code
=
"MODULE-20190919-0000006"
)
datas
=
rms_module
.
union
(
rms_module
,
rms_module2
)
else
:
datas
=
rms_module
mod
=
ModuleSerializer
(
data
=
datas
,
many
=
True
)
mod
.
is_valid
()
app_body
=
{}
...
...
app/applicationlayer/master/user_type/views.py
View file @
43f72c72
...
...
@@ -12,6 +12,12 @@ class UserTypeViewSet(APIView):
enums_department
=
enums
.
UserTypeEnum
.
DEPARTMENT_USER_ADMIN
.
value
enums_user
=
enums
.
UserTypeEnum
.
USER
.
value
enums_super_key
=
str
(
enums
.
UserTypeEnum
.
SUPER_USER
.
name
)
.
replace
(
'_'
,
' '
)
enums_OUA_key
=
str
(
enums
.
UserTypeEnum
.
OVERALL_USER_ADMIN
.
name
)
.
replace
(
'_'
,
' '
)
enums_company_key
=
str
(
enums
.
UserTypeEnum
.
COMPANY_USER_ADMIN
.
name
)
.
replace
(
'_'
,
' '
)
enums_department_key
=
str
(
enums
.
UserTypeEnum
.
DEPARTMENT_USER_ADMIN
.
name
)
.
replace
(
'_'
,
' '
)
enums_user_key
=
str
(
enums
.
UserTypeEnum
.
USER
.
name
)
.
replace
(
'_'
,
' '
)
data
=
{
"code"
:
"200"
,
"status"
:
"success"
,
...
...
@@ -19,11 +25,11 @@ class UserTypeViewSet(APIView):
"results"
:
# [
{
str
(
enums
.
UserTypeEnum
.
SUPER_USER
.
name
)
:
enums_super
,
str
(
enums
.
UserTypeEnum
.
OVERALL_USER_ADMIN
.
name
)
:
enums_OUA
,
str
(
enums
.
UserTypeEnum
.
COMPANY_USER_ADMIN
.
name
)
:
enums_company
,
str
(
enums
.
UserTypeEnum
.
DEPARTMENT_USER_ADMIN
.
name
)
:
enums_department
,
str
(
enums
.
UserTypeEnum
.
USER
.
name
)
:
enums_user
enums_super_key
:
enums_super
,
enums_OUA_key
:
enums_OUA
,
enums_company_key
:
enums_company
,
enums_department_key
:
enums_department
,
enums_user_key
:
enums_user
}
# ]
}
...
...
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