mirror of
https://github.com/erpnext/foundation.git
synced 2026-10-16 18:00:47 +02:00
refactor: removed dead code
This commit is contained in:
@@ -9,27 +9,10 @@ from frappe.model.document import Document
|
|||||||
class ConferenceParticipant(Document):
|
class ConferenceParticipant(Document):
|
||||||
def validate(self):
|
def validate(self):
|
||||||
self.conference = '2019'
|
self.conference = '2019'
|
||||||
# self.send_ticket_mail()
|
|
||||||
|
|
||||||
def validate_payment(self):
|
def validate_payment(self):
|
||||||
self.amount = self.full_conference_tickets * (5000 if self.currency == 'INR' else 70)
|
self.amount = self.full_conference_tickets * (5000 if self.currency == 'INR' else 70)
|
||||||
|
|
||||||
def on_payment_authorized(self, status_changed_to=None):
|
def on_payment_authorized(self, status_changed_to=None):
|
||||||
self.paid = 1
|
self.paid = 1
|
||||||
self.save(ignore_permissions=True)
|
self.save(ignore_permissions=True)
|
||||||
|
|
||||||
def send_ticket_mail(self):
|
|
||||||
if self.paid == 1 and self.email:
|
|
||||||
message = """Thank you for participating in the ERPNext Conference {0}.
|
|
||||||
<br> You can find your ticket attached with this email,
|
|
||||||
for more details about the conference please visit https://erpnext.com/conf/{0}""".format(self.conference)
|
|
||||||
email_args = {
|
|
||||||
"recipients": [self.email],
|
|
||||||
"message": message,
|
|
||||||
"subject": 'Your Ticket for ERPNext Conference 2019',
|
|
||||||
"attachments": [frappe.attach_print(self.doctype, self.name, file_name=self.name, print_format='Conference Ticket')],
|
|
||||||
"reference_doctype": self.doctype,
|
|
||||||
"reference_name": self.name
|
|
||||||
}
|
|
||||||
frappe.sendmail(**email_args)
|
|
||||||
self.thank_you_email_sent = 1
|
|
||||||
Reference in New Issue
Block a user