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
5310bf3a
Commit
5310bf3a
authored
Jan 06, 2020
by
Gladys Forte
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove unused codes
parent
dbdce785
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
56 deletions
+9
-56
app/applicationlayer/master/urls.py
app/applicationlayer/master/urls.py
+0
-3
app/applicationlayer/master/user_type/views.py
app/applicationlayer/master/user_type/views.py
+1
-12
app/helper/email_service/sender.py
app/helper/email_service/sender.py
+0
-39
media/uploads/user_format.csv
media/uploads/user_format.csv
+8
-2
No files found.
app/applicationlayer/master/urls.py
View file @
5310bf3a
...
@@ -5,7 +5,6 @@ from app.applicationlayer.master.Account.views import AdminAccountViewSet
...
@@ -5,7 +5,6 @@ from app.applicationlayer.master.Account.views import AdminAccountViewSet
from
app.applicationlayer.master.company.views
import
AdminCompanyViewSet
from
app.applicationlayer.master.company.views
import
AdminCompanyViewSet
from
app.applicationlayer.master.department.views
import
AdminDepartmentViewSet
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
UserTypeViewSet
from
app.applicationlayer.master.user_type.views
import
cronjob
from
app.applicationlayer.master.attachment.views
import
MasterAttachmentViewSet
from
app.applicationlayer.master.attachment.views
import
MasterAttachmentViewSet
router
=
routers
.
DefaultRouter
()
router
=
routers
.
DefaultRouter
()
...
@@ -13,10 +12,8 @@ router.register(r'users', AdminAccountViewSet)
...
@@ -13,10 +12,8 @@ router.register(r'users', AdminAccountViewSet)
router
.
register
(
r'companies'
,
AdminCompanyViewSet
)
router
.
register
(
r'companies'
,
AdminCompanyViewSet
)
router
.
register
(
r'departments'
,
AdminDepartmentViewSet
)
router
.
register
(
r'departments'
,
AdminDepartmentViewSet
)
router
.
register
(
r'attachments'
,
MasterAttachmentViewSet
)
router
.
register
(
r'attachments'
,
MasterAttachmentViewSet
)
# router.register(r'user-types', UserTypeViewSet)
urlpatterns
=
[
urlpatterns
=
[
path
(
''
,
include
(
router
.
urls
)),
path
(
''
,
include
(
router
.
urls
)),
url
(
r'^user-types/$'
,
UserTypeViewSet
.
as_view
(),
name
=
"user-types"
),
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
app/applicationlayer/master/user_type/views.py
View file @
5310bf3a
...
@@ -50,15 +50,4 @@ class UserTypeViewSet(APIView):
...
@@ -50,15 +50,4 @@ class UserTypeViewSet(APIView):
del
data
[
'results'
][
str
(
enums
.
UserTypeEnum
.
COMPANY_USER_ADMIN
.
name
)]
del
data
[
'results'
][
str
(
enums
.
UserTypeEnum
.
COMPANY_USER_ADMIN
.
name
)]
del
data
[
'results'
][
str
(
enums
.
UserTypeEnum
.
DEPARTMENT_USER_ADMIN
.
name
)]
del
data
[
'results'
][
str
(
enums
.
UserTypeEnum
.
DEPARTMENT_USER_ADMIN
.
name
)]
return
Response
(
data
)
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"
)
app/helper/email_service/sender.py
View file @
5310bf3a
...
@@ -13,15 +13,6 @@ from xhtml2pdf import pisa
...
@@ -13,15 +13,6 @@ from xhtml2pdf import pisa
from
email.mime.text
import
MIMEText
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
@
transaction
.
atomic
def
batch_email_users
(
args
):
def
batch_email_users
(
args
):
connection
=
email_connection
.
get_connection
()
connection
=
email_connection
.
get_connection
()
...
@@ -124,36 +115,6 @@ def account_created(args):
...
@@ -124,36 +115,6 @@ def account_created(args):
return
True
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
# direct mailer from django
def
forgot_password
(
args
):
def
forgot_password
(
args
):
reset_code
=
args
[
0
]
reset_code
=
args
[
0
]
...
...
media/uploads/user_format.csv
View file @
5310bf3a
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
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,,,,,,
,,,,,,,,,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,,,,
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