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
f986f244
Commit
f986f244
authored
Feb 04, 2020
by
Gladys Forte
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
{dev bugfix} Fix validation for Vendor with same level delegation
parent
24a065ad
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
10 deletions
+11
-10
app/applicationlayer/cms/form/header/views.py
app/applicationlayer/cms/form/header/views.py
+2
-2
app/applicationlayer/cms/template/header/views.py
app/applicationlayer/cms/template/header/views.py
+1
-1
app/businesslayer/changerequest/change_request_template.py
app/businesslayer/changerequest/change_request_template.py
+6
-5
app/helper/decorators.py
app/helper/decorators.py
+2
-2
No files found.
app/applicationlayer/cms/form/header/views.py
View file @
f986f244
...
@@ -752,7 +752,7 @@ class ChangeRequestFormsViewset(viewsets.ModelViewSet):
...
@@ -752,7 +752,7 @@ class ChangeRequestFormsViewset(viewsets.ModelViewSet):
return
Response
(
message
,
status
=
status
.
HTTP_200_OK
)
return
Response
(
message
,
status
=
status
.
HTTP_200_OK
)
@
FormValidation
#
@FormValidation
@
transaction
.
atomic
@
transaction
.
atomic
@
action
(
@
action
(
methods
=
[
'PATCH'
],
detail
=
True
,
methods
=
[
'PATCH'
],
detail
=
True
,
...
@@ -866,7 +866,7 @@ class ChangeRequestFormsViewset(viewsets.ModelViewSet):
...
@@ -866,7 +866,7 @@ class ChangeRequestFormsViewset(viewsets.ModelViewSet):
return
Response
(
message
,
status
=
status
.
HTTP_200_OK
)
return
Response
(
message
,
status
=
status
.
HTTP_200_OK
)
@
FormValidation
#
@FormValidation
@
transaction
.
atomic
@
transaction
.
atomic
@
action
(
@
action
(
methods
=
[
'PATCH'
],
detail
=
True
,
methods
=
[
'PATCH'
],
detail
=
True
,
...
...
app/applicationlayer/cms/template/header/views.py
View file @
f986f244
...
@@ -188,7 +188,7 @@ class ChangeRequestTemplatesViewset(viewsets.ModelViewSet):
...
@@ -188,7 +188,7 @@ class ChangeRequestTemplatesViewset(viewsets.ModelViewSet):
return
Response
(
e
,
return
Response
(
e
,
status
=
status
.
HTTP_500_INTERNAL_SERVER_ERROR
)
status
=
status
.
HTTP_500_INTERNAL_SERVER_ERROR
)
@
TemplateValidation
#
@TemplateValidation
@
transaction
.
atomic
@
transaction
.
atomic
def
partial_update
(
self
,
request
,
*
args
,
**
kwargs
):
def
partial_update
(
self
,
request
,
*
args
,
**
kwargs
):
...
...
app/businesslayer/changerequest/change_request_template.py
View file @
f986f244
...
@@ -175,7 +175,7 @@ def validation_poc_vendor_only(poc, approvers):
...
@@ -175,7 +175,7 @@ def validation_poc_vendor_only(poc, approvers):
# Check if level if Vendor delegation has same level with other delegation
# Check if level if Vendor delegation has same level with other delegation
def
validation_vendor_unique_level
(
approvers
):
def
validation_vendor_unique_level
(
approvers
):
validate
=
False
validate
=
0
data_level
=
[]
data_level
=
[]
for
approver
in
approvers
:
for
approver
in
approvers
:
...
@@ -186,6 +186,7 @@ def validation_vendor_unique_level(approvers):
...
@@ -186,6 +186,7 @@ def validation_vendor_unique_level(approvers):
for
approver
in
approvers
:
for
approver
in
approvers
:
if
'delegation'
in
approver
:
if
'delegation'
in
approver
:
if
approver
[
'level'
]
in
data_level
:
if
approver
[
'level'
]
in
data_level
:
if
not
approver
[
'delegation'
]
==
'DELEGATION-20191119-0000002'
:
if
(
not
approver
[
'delegation'
]
==
'DELEGATION-20191119-0000002'
validate
=
True
and
not
approver
[
'delegation'
]
==
''
):
validate
=
approver
[
'level'
]
return
validate
return
validate
app/helper/decorators.py
View file @
f986f244
...
@@ -350,8 +350,8 @@ def TemplateValidation(function):
...
@@ -350,8 +350,8 @@ def TemplateValidation(function):
# Do not allow to save Vendor same level to other delegation
# Do not allow to save Vendor same level to other delegation
validate
=
validation_vendor_unique_level
(
tmp_approvers
)
validate
=
validation_vendor_unique_level
(
tmp_approvers
)
if
validate
is
True
:
if
not
validate
==
0
:
return
error_message
(
'400'
,
'
Vendor/Implementor cannot have same level with other delegation/s
'
,
return
error_message
(
'400'
,
'
Level '
+
str
(
validate
)
+
' is already assigned for the Vendor/Implementor.
'
,
'failed'
,
status
.
HTTP_400_BAD_REQUEST
)
'failed'
,
status
.
HTTP_400_BAD_REQUEST
)
return
function
(
self
,
request
,
*
args
,
**
kwargs
)
return
function
(
self
,
request
,
*
args
,
**
kwargs
)
...
...
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