Merge pull request #17197 from nabinhait/training-feedback

fix: training feedback code cleanup
This commit is contained in:
Nabin Hait 2019-04-11 11:36:50 +05:30 committed by GitHub
commit 38351587fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -15,9 +15,11 @@ class TrainingFeedback(Document):
def on_submit(self):
training_event = frappe.get_doc("Training Event", self.training_event)
status = None
for e in training_event.employees:
if e.employee == self.employee:
training_event.status = 'Feedback Submitted'
status = 'Feedback Submitted'
break
training_event.save()
if status:
frappe.db.set_value("Training Event", self.training_event, "status", status)