Commit 5310bf3a authored by Gladys Forte's avatar Gladys Forte

remove unused codes

parent dbdce785
......@@ -5,7 +5,6 @@ from app.applicationlayer.master.Account.views import AdminAccountViewSet
from app.applicationlayer.master.company.views import AdminCompanyViewSet
from app.applicationlayer.master.department.views import AdminDepartmentViewSet
from app.applicationlayer.master.user_type.views import UserTypeViewSet
from app.applicationlayer.master.user_type.views import cronjob
from app.applicationlayer.master.attachment.views import MasterAttachmentViewSet
router = routers.DefaultRouter()
......@@ -13,10 +12,8 @@ router.register(r'users', AdminAccountViewSet)
router.register(r'companies', AdminCompanyViewSet)
router.register(r'departments', AdminDepartmentViewSet)
router.register(r'attachments', MasterAttachmentViewSet)
# router.register(r'user-types', UserTypeViewSet)
urlpatterns = [
path('', include(router.urls)),
url(r'^user-types/$', UserTypeViewSet.as_view(), name="user-types"),
url(r'^cronjob/$', cronjob.as_view(), name="user-types"),
]
\ No newline at end of file
......@@ -51,14 +51,3 @@ class UserTypeViewSet(APIView):
del data['results'][str(enums.UserTypeEnum.DEPARTMENT_USER_ADMIN.name)]
return Response(data)
\ No newline at end of file
class cronjob(APIView):
permission_classes = (AllowAny,)
def get(self, request, format=None):
args = ''
main_threading(args, sender.cronjob)
return Response("sent")
......@@ -13,15 +13,6 @@ from xhtml2pdf import pisa
from email.mime.text import MIMEText
def to_pdf():
F = open(os.path.join(settings.EMAIL_TEMPLATES_ROOT, 'RMS-NEWUSER.html'), 'r')
result = BytesIO()
pdf = pisa.pisaDocument(F, result)
if not pdf.err:
return HttpResponse(result.getvalue(), content_type='application/pdf')
return None
@transaction.atomic
def batch_email_users(args):
connection = email_connection.get_connection()
......@@ -124,36 +115,6 @@ def account_created(args):
return True
def cronjob(args):
try:
send_mail(
subject='Resource Management System: Welcome!',
message='',
from_email=settings.EMAIL_DEFAULT_SENDER,
recipient_list=('gladys@tirsolutions.com',),
html_message="FC",
fail_silently=False
)
models.EmailLogs.objects.create(
template='RMS-NEWUSER.html',
recipients="test",
content="FC",
is_sent=True,
createdby=admin,
modifiedby=admin
)
except Exception as e:
models.EmailLogs.objects.create(
template='RMS-NEWUSER.html',
recipients="test",
content="FC",
is_sent=False,
createdby="superuser",
modifiedby="superuser"
)
return True
# direct mailer from django
def forgot_password(args):
reset_code = args[0]
......
Username,Name,Company,Department,Department_Code,Email,Contact_No,Application,Default_app,Privilege_Company,Privilege_Department,Privilege_Department_Code,Create_CR,Create_Template,View_All_CR,Approve_CR
ob-john,John Doe,Oneberry Technologies,Sample Department,DEPARTMENT-20190101-0000000,johndoe@gmail.com,123456,"cms,ams",cms,Oneberry Technologies,Sample Department,DEPARTMENT-20190101-0000000,Yes,No,Yes,Yes
ob-john,John Doe,Oneberry Technologies Pte Ltd,Admin Department,DEPARTMENT-20191218-0000067,johndoe@gmail.com,123456,"cms,ams",cms,Oneberry Technologies Pte Ltd,Admin Department,DEPARTMENT-20191218-0000067,Yes,No,Yes,Yes
,,,,,,,,,Please use this department code as reference,,,,,,
,,,,,,,,,No Department Data,,,,,,
,,,,,,,,,Oneberry Technologies Pte Ltd,Admin Department,DEPARTMENT-20191218-0000067,,,,
,,,,,,,,,Oneberry Technologies Pte Ltd,Business Development,DEPARTMENT-20191121-0000064,,,,
,,,,,,,,,Oneberry Technologies Pte Ltd,IT Department,DEPARTMENT-20191219-0000069,,,,
,,,,,,,,,Jurong Town Corporation,Facilities Management,DEPARTMENT-20191121-0000062,,,,
,,,,,,,,,Jurong Town Corporation,Sample Department,DEPARTMENT-20191218-0000068,,,,
,,,,,,,,,Jurong Town Corporation,Security Division,DEPARTMENT-20191121-0000061,,,,
,,,,,,,,,Jurong Town Corporation,Warehouse Department,DEPARTMENT-20191121-0000065,,,,
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment