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
19bd01ac
Commit
19bd01ac
authored
Feb 05, 2020
by
Gladys Forte
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
{dev bugfix} template validation patch
parent
f986f244
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
app/applicationlayer/cms/template/header/views.py
app/applicationlayer/cms/template/header/views.py
+1
-1
app/helper/decorators.py
app/helper/decorators.py
+5
-5
No files found.
app/applicationlayer/cms/template/header/views.py
View file @
19bd01ac
...
@@ -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/helper/decorators.py
View file @
19bd01ac
...
@@ -309,12 +309,12 @@ def TemplateValidation(function):
...
@@ -309,12 +309,12 @@ def TemplateValidation(function):
'failed'
,
status
.
HTTP_400_BAD_REQUEST
)
'failed'
,
status
.
HTTP_400_BAD_REQUEST
)
# Check if prefix already exists
# Check if prefix already exists
prefix
=
ChangeRequestTemplateHeader
.
objects
.
filter
(
#
prefix = ChangeRequestTemplateHeader.objects.filter(
requested_to_template_id
=
template_header
[
'requested_to_template_id'
])
#
requested_to_template_id=template_header['requested_to_template_id'])
if
prefix
:
#
if prefix:
return
error_message
(
'400'
,
'CR Number prefix already exists.'
,
#
return error_message('400', 'CR Number prefix already exists.',
'failed'
,
status
.
HTTP_400_BAD_REQUEST
)
#
'failed', status.HTTP_400_BAD_REQUEST)
# Restrict form using Superuser Department
# Restrict form using Superuser Department
if
(
template_header
[
'created_by_department'
]
==
'DEPARTMENT-20190923-0000001'
or
if
(
template_header
[
'created_by_department'
]
==
'DEPARTMENT-20190923-0000001'
or
...
...
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