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
19129cb6
Commit
19129cb6
authored
Oct 07, 2019
by
Gladys Forte
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added is_action in resubmit and re route
parent
b1a541ed
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
99 additions
and
9 deletions
+99
-9
app/accesslayer/authentication.py
app/accesslayer/authentication.py
+1
-1
app/applicationlayer/cms/auto_email/reminder.py
app/applicationlayer/cms/auto_email/reminder.py
+40
-0
app/applicationlayer/cms/form/header/views.py
app/applicationlayer/cms/form/header/views.py
+5
-3
app/entities/models.py
app/entities/models.py
+48
-0
app/helper/email_service/sender.py
app/helper/email_service/sender.py
+4
-4
app/helper/email_service/templates/RMS-ACTIONREQUIRED.html
app/helper/email_service/templates/RMS-ACTIONREQUIRED.html
+1
-1
No files found.
app/accesslayer/authentication.py
View file @
19129cb6
...
...
@@ -12,7 +12,7 @@ class AppTokenAuthentication(TokenAuthentication):
user
,
token
=
super
(
AppTokenAuthentication
,
self
)
.
authenticate_credentials
(
key
)
if
token
.
created
<
datetime
.
now
()
-
timedelta
(
minutes
=
int
(
settings
.
SESSION_TIMEOUT
)):
token
.
delete
()
raise
exceptions
.
AuthenticationFailed
(
'Token has expired'
)
...
...
app/applicationlayer/cms/auto_email/reminder.py
View file @
19129cb6
# from app.entities import models
# from app.applicationlayer import paginators
# from datetime import datetime
# from rest_framework.response import Response
# from rest_framework import status, views
# from cms.applicationlayer.utilities import email
# from mongoengine.queryset.visitor import Q
# import requests
# from django.conf import settings
# from datetime import timedelta
# EMAIL = settings.EMAIL
# class ReminderAPIView(views.APIView):
# def get(self, request):
# print(request.META['HTTP_ACCOUNT_NO'])
# date_format = datetime.now()
# next_day = date_format + timedelta(days=1)
# today_mail = models.EmailNotification.objects.filter(
# Q(date_from__lte=date_format.strftime('%Y-%m-%d')) &
# Q(date_to__gte=date_format.strftime('%Y-%m-%d')) &
# Q(date_to_send=date_format.strftime('%Y-%m-%d 00:00:00.000'))
# )[0:25]
# print(len(today_mail))
# list_of_emails = []
# for data in today_mail:
# approver = requests.post(EMAIL, data=data['approver'])
# requestor = requests.post(EMAIL, data=data['requestor'])
# list_of_emails.append(data['approver'])
# list_of_emails.append(data['requestor'])
# today_mail.update(date_to_send=next_day)
# return Response(
# {"list of emails": list_of_emails},
# status=status.HTTP_200_OK
# )
app/applicationlayer/cms/form/header/views.py
View file @
19129cb6
...
...
@@ -513,7 +513,8 @@ class ChangeRequestFormsViewset(viewsets.ModelViewSet):
'action'
:
None
,
'remarks'
:
None
,
'date_sent'
:
None
,
'action_date'
:
None
'action_date'
:
None
,
'is_action'
:
True
}
approver_data
.
append
(
approver_add
)
...
...
@@ -618,9 +619,10 @@ class ChangeRequestFormsViewset(viewsets.ModelViewSet):
'remarks'
:
None
,
'date_sent'
:
None
,
'action_date'
:
None
,
'created'
:
datetime
.
now
()
'created'
:
datetime
.
now
(),
'is_action'
:
True
}
approver_data
.
append
(
approver_add
)
change_request
.
form_add_edit_delete
(
...
...
app/entities/models.py
View file @
19129cb6
...
...
@@ -1005,3 +1005,51 @@ class AllowedCompany(models.Model):
class
Meta
:
db_table
=
'allowed_company'
# class EmailNotification(models.Model):
# cr_number = models.CharField(
# null=True,
# blank=True)
# approver = models.CharField(
# null=True,
# blank=True)
# requestor = models.CharField(
# null=True,
# blank=True)
# date_from = models.DateTimeField(
# null=True,
# blank=True)
# date_to = models.DateTimeField(
# null=True,
# blank=True)
# date_to_send = models.DateTimeField(
# null=True,
# blank=True)
# class Meta:
# db_table = 'email_notification'
# class CancelDateCR(Document):
# meta = {'collection': 'cancel_date_change_request'}
# cr_number = fields.StringField(required=True)
# trigger_date = fields.DateTimeField(required=True)
# deleted_at = fields.DateTimeField(required=False, null=True)
# is_sent = fields.BooleanField(default=False)
# date_submitted_last_approver = fields.StringField(required=False)
# approver_pending_action = fields.StringField(required=False)
# email_content = fields.DictField(required=True)
# class Meta:
# db_table = 'email_notification'
# class TargetDateOverdue(Document):
# meta = {'collection': 'target_date_overdue'}
# cr_number = fields.StringField(required=True)
# trigger_date = fields.DateTimeField(required=True)
# is_sent = fields.BooleanField(default=False)
# email_content = fields.DictField(required=True)
\ No newline at end of file
app/helper/email_service/sender.py
View file @
19129cb6
...
...
@@ -23,7 +23,7 @@ def account_created(args):
FC
=
FC
.
replace
(
'{url}'
,
settings
.
FRONT_END_URL
+
'/cms/profile'
)
#changed
try
:
send_mail
(
subject
=
'
OB RMS
: Welcome!'
,
subject
=
'
Resource Management System
: Welcome!'
,
message
=
''
,
from_email
=
settings
.
EMAIL_DEFAULT_SENDER
,
recipient_list
=
(
recipient
,),
...
...
@@ -66,7 +66,7 @@ def forgot_password(args):
FC
=
FC
.
replace
(
'{url}'
,
url
)
send_mail
(
subject
=
'
OB RMS
: Reset Password'
,
subject
=
'
Resource Management System
: Reset Password'
,
message
=
''
,
from_email
=
settings
.
EMAIL_DEFAULT_SENDER
,
recipient_list
=
[
recipient
,
admin
,],
...
...
@@ -75,7 +75,7 @@ def forgot_password(args):
try
:
send_mail
(
subject
=
'
OB RMS: Welcome!
'
,
subject
=
'
Resource Management System: Reset Password
'
,
message
=
''
,
from_email
=
settings
.
EMAIL_DEFAULT_SENDER
,
recipient_list
=
recipient
,
...
...
@@ -136,7 +136,7 @@ def admin_changepassword(args):
FC
=
FC
.
replace
(
'{url}'
,
settings
.
FRONT_END_URL
)
send_mail
(
subject
=
'
OB RMS
: Password Changed'
,
subject
=
'
Resource Management System
: Password Changed'
,
message
=
''
,
from_email
=
settings
.
EMAIL_DEFAULT_SENDER
,
recipient_list
=
[
recipient
,
admin
,],
...
...
app/helper/email_service/templates/RMS-ACTIONREQUIRED.html
View file @
19129cb6
...
...
@@ -3,7 +3,7 @@
<head>
<title>
RMS: Approval Notification
</title>
</head>
<body
style=
"font-family:
arial
;"
>
<body
style=
"font-family:
Sans-Serif
;"
>
<h3>
Resource Management System
(
RMS
)
</h3>
<h3
style=
"color:#888888;"
>
Change Request Approval Notification
</h3><br>
...
...
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