Skip to content

Commit

Permalink
refactor: moved one server script to autoinscribe_integration
Browse files Browse the repository at this point in the history
  • Loading branch information
deepak-redsoftware committed Jan 9, 2024
1 parent a685f83 commit bd6110a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,22 @@ def create_address(self, address):

@frappe.whitelist()
def extract_text_from_img(img_url):
'''Calls extract_text_from_img method inside AutoInscribe Integration'''

doc = frappe.get_single("AutoInscribe Integration")
return doc.extract_text_from_img(img_url)


@frappe.whitelist()
def create_address(address):
'''Calls create_address method inside AutoInscribe Integration'''

doc = frappe.get_single("AutoInscribe Integration")
return doc.create_address(address)


def display_contact_error_after_insert(contact, event):
'''Displays error message (if any) to user after contact insert'''

if contact.custom_upload_image and not contact.first_name:
frappe.msgprint("Please check your AutoInscribe Settings and try again", title="Invalid AutoInscribe Settings", indicator="red")
21 changes: 0 additions & 21 deletions autoinscribe/fixtures/server_script.json

This file was deleted.

9 changes: 6 additions & 3 deletions autoinscribe/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,12 @@
# }
# }

doc_events = {
"Contact": {
"after_insert": "autoinscribe.autoinscribe.doctype.autoinscribe_integration.autoinscribe_integration.display_contact_error_after_insert",
},
}

# Scheduled Tasks
# ---------------

Expand Down Expand Up @@ -232,9 +238,6 @@
# }

fixtures = [
{
"doctype": "Server Script",
},
{
"dt": "Custom Field",
"filters": [
Expand Down

0 comments on commit bd6110a

Please sign in to comment.