School no Email for Student returns Error

When enrolling and if the Student has not email … even after adding the email and trying again

Error Report

Python 2.7.12: /home/frappe/frappe-bench/env/bin/python (prefix: /home/frappe/frappe-bench/env)

Timestamp:
2017-10-10 15:38:04.325664
Relapsed
1
Exception

args (‘sequence item 0: expected string or Unicode, NoneType found’,)
message ‘sequence item 0: expected string or Unicode, NoneType found’
Locals

self
student_email_id None
student_emails [None]
Traceback

/home/frappe/frappe-bench/apps/frappe/frappe/app.py: 57

55
56 if frappe.local.form_dict.cmd:
57 response = frappe.handler.handle()
58
59 elif frappe.request.path.startswith("/api/"):
Locals
/home/frappe/frappe-bench/apps/frappe/frappe/handler.py: 22

20
21 if cmd!=‘login’:
22 data = execute_cmd(cmd)
23
24 if data:
Locals
/home/frappe/frappe-bench/apps/frappe/frappe/handler.py: 53

51 is_whitelisted(method)
52
53 return frappe.call(method, **frappe.form_dict)
54
55
Locals
/home/frappe/frappe-bench/apps/frappe/frappe/init.py: 923

921 del newargs[“flags”]
922
923 return fn(*args, **newargs)
924
925 def make_property_setter(args, ignore_validate=False, validate_fields_for_doctype=True):
Locals
/home/frappe/frappe-bench/apps/frappe/frappe/desk/form/save.py: 19

17
18 if doc.docstatus==1:
19 doc.submit()
20 else:
21 try:
Locals
/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py: 778

776 def submit(self):
777 “”“Submit the document. Sets docstatus = 1, then saves.”""
778 self._submit()
779
780 @whitelist.func
Locals
/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py: 767

765 “”“Submit the document. Sets docstatus = 1, then saves.”""
766 self.docstatus = 1
767 self.save()
768
769 @whitelist.func
Locals
/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py: 256

254 def save(self, *args, **kwargs):
255 “”“Wrapper for _save”""
256 return self._save(*args, **kwargs)
257
258 def _save(self, ignore_permissions=None, ignore_version=None):
Locals
/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py: 307

305
306 self.update_children()
307 self.run_post_save_methods()
308
309 return self
Locals
/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py: 830

828 elif self._action==“submit”:
829 self.run_method(“on_update”)
830 self.run_method(“on_submit”)
831 elif self._action==“cancel”:
832 self.run_method(“on_cancel”)
Locals
/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py: 702

700
701 fn.name = str(method)
702 out = Document.hook(fn)(self, *args, **kwargs)
703
704 self.run_email_alerts(method)
Locals
/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py: 924

922
923 composed = compose(f, *hooks)
924 return composed(self, method, *args, **kwargs)
925
926 return composer
Locals
/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py: 907

905 def compose(fn, *hooks):
906 def runner(self, method, *args, **kwargs):
907 add_to_return_value(self, fn(self, *args, **kwargs))
908 for f in hooks:
909 add_to_return_value(self, f(self, method, *args, **kwargs))
Locals
/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py: 696

694
695 if hasattr(self, method) and hasattr(getattr(self, method), “call”):
696 fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
697 else:
698 # hack! to run hooks even if method does not exist
Locals
/home/frappe/frappe-bench/apps/erpnext/erpnext/schools/doctype/program_enrollment/program_enrollment.py: 20

18 def on_submit(self):
19 self.update_student_joining_date()
20 self.make_fee_records()
21
22 def validate_duplication(self):
Locals
/home/frappe/frappe-bench/apps/erpnext/erpnext/schools/doctype/program_enrollment/program_enrollment.py: 51

49 })
50
51 fees.save()
52 fees.submit()
53 fee_list.append(fees.name)
Locals
/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py: 256

254 def save(self, *args, **kwargs):
255 “”“Wrapper for _save”""
256 return self._save(*args, **kwargs)
257
258 def _save(self, ignore_permissions=None, ignore_version=None):
Locals
/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py: 279

277
278 if self.get("__islocal") or not self.get(“name”):
279 self.insert()
280 return
281
Locals
/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py: 218

216 self.flags.in_insert = True
217 self._validate_links()
218 self.run_before_save_methods()
219 self._validate()
220 self.set_docstatus()
Locals
/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py: 809

807
808 if self._action==“save”:
809 self.run_method(“validate”)
810 self.run_method(“before_save”)
811 elif self._action==“submit”:
Locals
/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py: 702

700
701 fn.name = str(method)
702 out = Document.hook(fn)(self, *args, **kwargs)
703
704 self.run_email_alerts(method)
Locals
/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py: 924

922
923 composed = compose(f, *hooks)
924 return composed(self, method, *args, **kwargs)
925
926 return composer
Locals
/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py: 907

905 def compose(fn, *hooks):
906 def runner(self, method, *args, **kwargs):
907 add_to_return_value(self, fn(self, *args, **kwargs))
908 for f in hooks:
909 add_to_return_value(self, f(self, method, *args, **kwargs))
Locals
/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py: 696

694
695 if hasattr(self, method) and hasattr(getattr(self, method), “call”):
696 fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
697 else:
698 # hack! to run hooks even if method does not exist
Locals
/home/frappe/frappe-bench/apps/erpnext/erpnext/schools/doctype/fees/fees.py: 28

26 def validate(self):
27 self.calculate_total()
28 self.set_missing_accounts_and_fields()
29
30 def set_missing_accounts_and_fields(self):
Locals
/home/frappe/frappe-bench/apps/erpnext/erpnext/schools/doctype/fees/fees.py: 46

44 self.cost_center = accounts_details.cost_center
45 if not self.student_email:
46 self.student_email = self.get_student_emails()
47
48 def get_student_emails(self):
Locals
/home/frappe/frappe-bench/apps/erpnext/erpnext/schools/doctype/fees/fees.py: 59

57 student_emails.append(student_email_id)
58 if student_emails:
59 return ", ".join(list(set(student_emails)))
60 else:
61 return None
Locals

Sorry for the inconvenience. This looks like a bug. Please report this on github

@Helio_Jesus,

This issue might be fixed in https://github.com/frappe/erpnext/pull/11116, Can you please check again