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
fc506ac5
Commit
fc506ac5
authored
Oct 01, 2019
by
John Red Medrano
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
clean code at current user and fixed the list of user on CRs drop down
parent
6584012f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
25 deletions
+3
-25
app/applicationlayer/cms/master/account/views.py
app/applicationlayer/cms/master/account/views.py
+2
-1
app/applicationlayer/management/user/serializers.py
app/applicationlayer/management/user/serializers.py
+0
-23
app/entities/models.py
app/entities/models.py
+1
-1
No files found.
app/applicationlayer/cms/master/account/views.py
View file @
fc506ac5
...
...
@@ -20,7 +20,8 @@ class UserList(APIView):
company
=
self
.
request
.
query_params
[
'company_code'
]
user_list
=
models
.
AllowedCompany
.
objects
.
filter
(
Q
(
company_pivot
=
company
)
&
Q
(
group_pivots
=
dept
)
Q
(
group_pivots
=
dept
)
&
Q
(
id_number
=
request
.
user
.
code
)
)
user_list
=
user_list
.
exclude
(
id
=
1
)
.
values
(
'id_number'
)
queryset
=
models
.
User
.
objects
.
filter
(
code__in
=
user_list
)
.
order_by
(
'name'
)
...
...
app/applicationlayer/management/user/serializers.py
View file @
fc506ac5
...
...
@@ -96,23 +96,6 @@ class UserManagementRetreiveSerializer(serializers.ModelSerializer):
rms
=
models
.
Application
.
objects
.
filter
(
id
=
1
)
.
values
()
.
first
()
for
data
in
app
:
# if data.id == 1:
# if user.user_type.upper() == enums.UserTypeEnum.SUPER_USER.value:
# rms_module = models.Module.objects.filter(
# Q(application=rms['code']) &
# Q(parent=0)
# )
# elif user.user_type.upper() != enums.UserTypeEnum.USER.value:
# rms_module = models.Module.objects.filter(
# code="MODULE-20190919-0000006"
# )
# else:
# rms_module = data.modules.all()
# 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
=
data
.
modules
.
filter
(
~
Q
(
name__icontains
=
'header'
))
if
user
.
user_type
.
upper
()
!=
enums
.
UserTypeEnum
.
USER
.
value
:
if
user
.
user_type
.
upper
()
!=
enums
.
UserTypeEnum
.
USER
.
value
:
...
...
@@ -120,12 +103,6 @@ class UserManagementRetreiveSerializer(serializers.ModelSerializer):
name__icontains
=
"user"
)
mod
=
mod
.
union
(
mod
,
user_module
)
# else:
# mod = user_module = models.Module.objects.filter(
# name__icontains="user"
# )
# mod = mod.exclude(parent=0)
mod
=
mod
.
order_by
(
"parent"
,
"sort_id"
)
mod
=
ModuleSerializer
(
data
=
mod
,
many
=
True
)
...
...
app/entities/models.py
View file @
fc506ac5
...
...
@@ -741,7 +741,7 @@ class ChangeRequestFormApprovers(BaseApprover):
null
=
True
)
action_date
=
models
.
DateTimeField
(
blank
=
True
,
null
=
True
)
null
=
True
)
date_sent
=
models
.
DateTimeField
(
blank
=
True
,
null
=
True
)
...
...
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