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
a3cc9178
Commit
a3cc9178
authored
Jan 15, 2020
by
Gladys Forte
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adjust approvers model
parent
7ee2d4c3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
18 deletions
+44
-18
app/applicationlayer/cms/cms_settings/views.py
app/applicationlayer/cms/cms_settings/views.py
+0
-12
app/entities/migrations/0004_auto_20200115_1036.py
app/entities/migrations/0004_auto_20200115_1036.py
+30
-0
app/entities/models.py
app/entities/models.py
+14
-6
No files found.
app/applicationlayer/cms/cms_settings/views.py
View file @
a3cc9178
...
...
@@ -63,28 +63,16 @@ class CMSSettingsViewSet(viewsets.ModelViewSet):
logged_user
=
self
.
request
.
user
.
code
data_cms_settings
=
[]
data_behalf_user
=
[]
cms_settings
=
request
.
data
[
'cms_settings'
]
for
cms_setting
in
cms_settings
:
cms_setting
[
'active_user'
]
=
logged_user
data_cms_settings
.
append
(
cms_setting
)
data_behalf_user
.
append
(
cms_setting
[
'behalf_user'
])
serializer
=
ChangeRequestSettingsSerializer
(
data
=
data_cms_settings
,
many
=
True
)
# removed_behalf_user = ChangeRequestSettings.objects.filter(
# active_user=logged_user
# ).exclude(behalf_user__in=data_behalf_user).values('behalf_user')
# print(removed_behalf_user)
# existing
# new
# removed
ChangeRequestSettings
.
objects
.
filter
(
active_user
=
logged_user
)
.
delete
()
if
serializer
.
is_valid
(
raise_exception
=
True
):
...
...
app/entities/migrations/0004_auto_20200115_1036.py
0 → 100644
View file @
a3cc9178
# Generated by Django 2.2 on 2020-01-15 10:36
from
django.conf
import
settings
from
django.db
import
migrations
,
models
import
django.db.models.deletion
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'entities'
,
'0003_auto_20200113_2144'
),
]
operations
=
[
migrations
.
AlterField
(
model_name
=
'changerequestformapprovers'
,
name
=
'user'
,
field
=
models
.
ForeignKey
(
blank
=
True
,
null
=
True
,
on_delete
=
django
.
db
.
models
.
deletion
.
PROTECT
,
related_name
=
'cms_form_approver_user'
,
to
=
settings
.
AUTH_USER_MODEL
,
to_field
=
'code'
),
),
migrations
.
AlterField
(
model_name
=
'changerequesttemplateapprovers'
,
name
=
'user'
,
field
=
models
.
ForeignKey
(
blank
=
True
,
null
=
True
,
on_delete
=
django
.
db
.
models
.
deletion
.
PROTECT
,
related_name
=
'cms_temp_approver_user'
,
to
=
settings
.
AUTH_USER_MODEL
,
to_field
=
'code'
),
),
migrations
.
AlterField
(
model_name
=
'extracttransformload'
,
name
=
'model_type'
,
field
=
models
.
CharField
(
choices
=
[(
'APP'
,
'APP'
),
(
'MODULE'
,
'MODULE'
),
(
'COMPANY'
,
'COMPANY'
),
(
'DEPARTMENT'
,
'DEPARTMENT'
),
(
'USER'
,
'USER'
),
(
'DELEGATION'
,
'DELEGATION'
),
(
'NOTIF'
,
'NOTIF'
),
(
'TMP'
,
'TMP'
),
(
'TMPAPR'
,
'TMPAPR'
),
(
'TMPSTK'
,
'TMPSTK'
),
(
'TMPATCH'
,
'TMPATCH'
),
(
'TMPDETAIL'
,
'TMPDETAIL'
),
(
'FRM'
,
'FRM'
),
(
'FRMAPR'
,
'FRMAPR'
),
(
'FRMSTK'
,
'FRMSTK'
),
(
'FRMATCH'
,
'FRMATCH'
),
(
'FRMDETAIL'
,
'FRMDETAIL'
),
(
'ETL'
,
'ETL'
),
(
'AMSGRP'
,
'AMSGRP'
),
(
'CMSSET'
,
'CMSSET'
)],
default
=
'USER'
,
max_length
=
100
),
),
]
app/entities/models.py
View file @
a3cc9178
...
...
@@ -480,12 +480,6 @@ class BaseHeader(models.Model):
class
BaseApprover
(
models
.
Model
):
level
=
models
.
IntegerField
()
user
=
models
.
ForeignKey
(
User
,
blank
=
True
,
null
=
True
,
on_delete
=
models
.
PROTECT
,
to_field
=
'code'
)
delegation
=
models
.
ForeignKey
(
Delegation
,
blank
=
True
,
...
...
@@ -656,6 +650,13 @@ class ChangeRequestTemplateApprovers(BaseApprover):
is_default
=
models
.
BooleanField
(
default
=
False
)
user
=
models
.
ForeignKey
(
User
,
blank
=
True
,
null
=
True
,
on_delete
=
models
.
PROTECT
,
to_field
=
'code'
,
related_name
=
'cms_temp_approver_user'
)
class
Meta
:
db_table
=
'change_request_template_approvers'
...
...
@@ -851,6 +852,13 @@ class ChangeRequestFormApprovers(BaseApprover):
blank
=
True
,
null
=
True
,
to_field
=
'code'
)
user
=
models
.
ForeignKey
(
User
,
blank
=
True
,
null
=
True
,
on_delete
=
models
.
PROTECT
,
to_field
=
'code'
,
related_name
=
'cms_form_approver_user'
)
class
Meta
:
db_table
=
'change_request_form_approvers'
...
...
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