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
50d6ca7d
Commit
50d6ca7d
authored
Nov 29, 2019
by
Gladys Forte
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new routing reject initial
parent
d3b54812
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
81 additions
and
16 deletions
+81
-16
app/accesslayer/views.py
app/accesslayer/views.py
+1
-1
app/applicationlayer/cms/form/header/views.py
app/applicationlayer/cms/form/header/views.py
+2
-4
app/businesslayer/changerequest/change_request.py
app/businesslayer/changerequest/change_request.py
+77
-10
app/helper/decorators.py
app/helper/decorators.py
+1
-1
No files found.
app/accesslayer/views.py
View file @
50d6ca7d
...
@@ -164,7 +164,7 @@ class ForgotPassword(APIView):
...
@@ -164,7 +164,7 @@ class ForgotPassword(APIView):
created
=
date_now
,
created
=
date_now
,
timeout_at
=
timeout_at
timeout_at
=
timeout_at
)
.
save
()
)
.
save
()
url
=
f
"{settings.FRONT_END_URL}/forgot-password/reset"
\
url
=
f
"{settings.FRONT_END_URL}/forgot-password/reset"
\
f
"?token={TOKEN}"
f
"?token={TOKEN}"
...
...
app/applicationlayer/cms/form/header/views.py
View file @
50d6ca7d
...
@@ -694,11 +694,9 @@ class ChangeRequestFormsViewset(viewsets.ModelViewSet):
...
@@ -694,11 +694,9 @@ class ChangeRequestFormsViewset(viewsets.ModelViewSet):
action_body
=
request
.
data
action_body
=
request
.
data
id
=
action_body
.
get
(
'id'
,
False
)
id
=
action_body
.
get
(
'id'
,
False
)
form_code
=
action_body
.
get
(
'form_code'
,
False
)
form_code
=
action_body
.
get
(
'form_code'
,
False
)
# delegation = action_body.get('delegation', False)
action
=
action_body
.
get
(
'action'
,
False
)
action
=
action_body
.
get
(
'action'
,
False
)
# level = action_body.get('level', False)
# next_level = int(level) + 1
remarks
=
action_body
.
get
(
'remarks'
,
False
)
remarks
=
action_body
.
get
(
'remarks'
,
False
)
move_to_level
=
action_body
.
get
(
'move_to_level'
,
False
)
# generate batchno history
# generate batchno history
batchno
=
get_max_batchno
(
"batch"
)
batchno
=
get_max_batchno
(
"batch"
)
...
@@ -735,7 +733,7 @@ class ChangeRequestFormsViewset(viewsets.ModelViewSet):
...
@@ -735,7 +733,7 @@ class ChangeRequestFormsViewset(viewsets.ModelViewSet):
new_instance
new_instance
)
)
change_request
.
cr_routing_actions
(
new_instance
,
current_user
)
change_request
.
cr_routing_actions
(
new_instance
,
current_user
,
move_to_level
)
# ---------------- removed code
# ---------------- removed code
message
=
status_message_response
(
message
=
status_message_response
(
200
,
'success'
,
200
,
'success'
,
...
...
app/businesslayer/changerequest/change_request.py
View file @
50d6ca7d
...
@@ -517,7 +517,7 @@ def update_form_header_status(form_code, status):
...
@@ -517,7 +517,7 @@ def update_form_header_status(form_code, status):
return
True
return
True
def
cr_routing_actions
(
approver_instance
,
current_user
):
def
cr_routing_actions
(
approver_instance
,
current_user
,
move_to_level
):
form_code
=
approver_instance
[
'form_code'
]
form_code
=
approver_instance
[
'form_code'
]
delegation
=
approver_instance
[
'delegation'
][
'name'
]
delegation
=
approver_instance
[
'delegation'
][
'name'
]
...
@@ -627,18 +627,85 @@ def cr_routing_actions(approver_instance, current_user):
...
@@ -627,18 +627,85 @@ def cr_routing_actions(approver_instance, current_user):
)
)
elif
approver_instance
[
'action'
]
.
lower
()
==
'rejected'
:
elif
approver_instance
[
'action'
]
.
lower
()
==
'rejected'
:
# update_form_header_status(form_code, 'Rejected')
# # EMAIL CODE FOR REQUESTOR
# requestor_notification_msg = REQUESTOR_REJECT_MESSAGE.split(';')[0]
update_form_header_status
(
form_code
,
'Rejected'
)
# # SEND EMAIL AND NOTIF TO REQUESTOR
# send_mail_requestor(
# current_user, form_code, delegation,
# requestor_notification_msg, action,
# remarks, level
# )
# EMAIL CODE FOR REQUESTOR
# send email to vendor
requestor_notification_msg
=
REQUESTOR_REJECT_MESSAGE
.
split
(
';'
)[
0
]
if
delegation
.
lower
()
==
'requestor'
:
notification_msg
=
REVISED_MESSAGE
.
split
(
';'
)[
0
]
# send reject email to vendor
send_mail_vendor
(
current_user
,
form_code
,
delegation
,
notification_msg
,
action
,
remarks
,
level
)
prev_level
=
int
(
level
)
-
1
# reset last vendor details
models
.
ChangeRequestFormApprovers
.
objects
.
filter
(
Q
(
form_code
=
form_code
)
&
Q
(
level
=
int
(
prev_level
))
)
.
update
(
is_action
=
True
,
action
=
'Acknowledged'
,
action_date
=
datetime
.
now
(),
date_sent
=
datetime
.
now
()
)
# SEND EMAIL AND NOTIF TO REQUESTOR
else
:
send_mail_requestor
(
current_user
,
form_code
,
delegation
,
# move_to_level
requestor_notification_msg
,
action
,
remarks
,
level
back_to_approver
=
models
.
ChangeRequestFormApprovers
.
objects
.
filter
(
)
Q
(
form_code
=
form_code
)
&
Q
(
level
=
move_to_level
)
)
.
first
()
print
(
back_to_approver
.
delegation
.
name
)
# prev_vendor = check_vendor_level(
# 'prev', level, form_code)
# if prev_vendor.count() > 0:
# notification_msg = REVISED_MESSAGE.split(';')[0]
# send_mail_vendor(
# current_user, form_code, 'others',
# notification_msg, action,
# remarks, level
# )
# last_action_vendor = prev_vendor.last()
# models.ChangeRequestFormApprovers.objects.filter(
# code=last_action_vendor
# ).update(
# is_action=True,
# action='Acknowledged',
# action_date=datetime.now(),
# date_sent=datetime.now()
# )
# models.ChangeRequestFormApprovers.objects.filter(
# Q(form_code=form_code) & Q(level__gte=int(level))
# ).update(
# is_action=False,
# action=None,
# remarks=None,
# action_date=None,
# date_sent=None
# )
elif
approver_instance
[
'action'
]
.
lower
()
==
'completed'
:
elif
approver_instance
[
'action'
]
.
lower
()
==
'completed'
:
...
...
app/helper/decorators.py
View file @
50d6ca7d
...
@@ -13,7 +13,7 @@ def error_safe(function):
...
@@ -13,7 +13,7 @@ def error_safe(function):
def
wrap
(
request
,
*
args
,
**
kwargs
):
def
wrap
(
request
,
*
args
,
**
kwargs
):
stat
=
status
.
HTTP_500_INTERNAL_SERVER_ERROR
stat
=
status
.
HTTP_500_INTERNAL_SERVER_ERROR
try
:
try
:
return
function
(
request
,
*
args
,
**
kwargs
)
return
function
(
request
,
*
args
,
**
kwargs
)
# except 'DoesNotExist' as ex:
# except 'DoesNotExist' as ex:
# print('ddd')
# print('ddd')
# stat = status.HTTP_404_NOT_FOUND
# stat = status.HTTP_404_NOT_FOUND
...
...
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