Merge pull request #15174 from ruchamahabal/event-last-update

fix: Delete Event Producer Last Update on trash event of Event Producer
This commit is contained in:
mergify[bot] 2021-12-03 14:53:51 +00:00 committed by GitHub
commit fec76ba950
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -54,6 +54,11 @@ class EventProducer(Document):
self.db_set('incoming_change', 0)
self.reload()
def on_trash(self):
last_update = frappe.db.get_value('Event Producer Last Update', dict(event_producer=self.name))
if last_update:
frappe.delete_doc('Event Producer Last Update', last_update)
def check_url(self):
valid_url_schemes = ("http", "https")
frappe.utils.validate_url(self.producer_url, throw=True, valid_schemes=valid_url_schemes)