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
39587ad4
Commit
39587ad4
authored
Jan 16, 2020
by
Gladys Forte
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
history onbehalf key
parent
f7a7c2a7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
2 deletions
+18
-2
app/applicationlayer/cms/form/header/views.py
app/applicationlayer/cms/form/header/views.py
+18
-2
No files found.
app/applicationlayer/cms/form/header/views.py
View file @
39587ad4
...
...
@@ -717,7 +717,10 @@ class ChangeRequestFormsViewset(viewsets.ModelViewSet):
}
else
:
data_update
=
{
"on_behalf"
:
current_user
"on_behalf"
:
{
'code'
:
self
.
request
.
user
.
code
,
'name'
:
self
.
request
.
user
.
name
}
}
new_instance
=
{
**
new_instance
,
**
data_update
}
...
...
@@ -1069,6 +1072,18 @@ class ChangeRequestFormsViewset(viewsets.ModelViewSet):
data
=
data
[
'toValue'
]
.
replace
(
"'"
,
'"'
)
.
replace
(
'None'
,
'""'
)
.
replace
(
'True'
,
'""'
)
.
replace
(
'False'
,
'""'
)
convert
=
json
.
loads
(
data
)
try
:
if
convert
[
'on_behalf'
]
and
not
convert
[
'on_behalf'
]
==
None
:
# format: Rejected on behalf by Rita Fantilga
on_behalf
=
(
convert
[
'action'
]
.
capitalize
()
+
' on behalf by '
+
convert
[
'on_behalf'
][
'name'
])
else
:
on_behalf
=
None
except
Exception
as
e
:
on_behalf
=
None
history_dict
=
{
"name"
:
convert
[
'user'
][
'name'
],
"department"
:
convert
[
'department'
][
'name'
],
...
...
@@ -1076,7 +1091,8 @@ class ChangeRequestFormsViewset(viewsets.ModelViewSet):
"date_sent"
:
convert
[
'date_sent'
],
"delegation"
:
convert
[
'delegation'
],
"action"
:
convert
[
'action'
],
"remarks"
:
convert
[
'remarks'
]
&
convert
[
'on_behalf'
],
"remarks"
:
convert
[
'remarks'
],
"on_behalf"
:
on_behalf
,
"created"
:
convert
[
'action_date'
]
}
...
...
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