Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable Email Alert if field does not exist #3372

Closed
anandpdoshi opened this issue May 28, 2015 · 1 comment
Closed

Disable Email Alert if field does not exist #3372

anandpdoshi opened this issue May 28, 2015 · 1 comment
Assignees

Comments

@anandpdoshi
Copy link
Contributor

In trigger email alert, if the field specified in date_changed or value_changed does not exist anymore .i.e catch the below exception, disable the email alert and notify the user that it is disabled to prevent future errors.

Traceback (most recent call last):
  File "/home/frappe/press/benches/1505261338/env/lib/python2.7/site-packages/celery/app/trace.py", line 240, in trace_task
    R = retval = fun(*args, **kwargs)
  File "/home/frappe/press/benches/1505261338/env/lib/python2.7/site-packages/celery/app/trace.py", line 438, in __protected_call__
    return self.run(*args, **kwargs)
  File "/home/frappe/press/benches/1505261338/apps/frappe/frappe/tasks.py", line 77, in scheduler_task
    frappe.get_attr(handler)()
  File "/home/frappe/press/benches/1505261338/apps/frappe/frappe/email/doctype/email_alert/email_alert.py", line 23, in trigger_daily_alerts
    trigger_email_alerts(None, "daily")
  File "/home/frappe/press/benches/1505261338/apps/frappe/frappe/email/doctype/email_alert/email_alert.py", line 43, in trigger_email_alerts
    (nowdate(), diff_days or 0)):
  File "/home/frappe/press/benches/1505261338/apps/frappe/frappe/database.py", line 192, in sql_list
    return [r[0] for r in self.sql(query, values, debug=debug)]
  File "/home/frappe/press/benches/1505261338/apps/frappe/frappe/database.py", line 135, in sql
    self._cursor.execute(query, values)
  File "/home/frappe/press/benches/1505261338/env/lib/python2.7/site-packages/MySQLdb/cursors.py", line 205, in execute
    self.errorhandler(self, exc, value)
  File "/home/frappe/press/benches/1505261338/env/lib/python2.7/site-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
    raise errorclass, errorvalue
OperationalError: (1054, "Unknown column 'visa_exp_date' in 'where clause'")
@anandpdoshi
Copy link
Contributor Author

  • Could also add comment to the disabled Email Alert about what exactly was the error i.e. Unknown column 'visa_exp_date' in 'where clause'

@anandpdoshi anandpdoshi added the ux label May 28, 2015
@rmehta rmehta removed the ux label Apr 27, 2017
@rmehta rmehta self-assigned this May 15, 2017
rmehta added a commit to rmehta/frappe that referenced this issue May 15, 2017
@rmehta rmehta closed this as completed May 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants