Browse Source

Procedure content details

master
venkataakhil 1 year ago
parent
commit
2a80a77a79
  1. 4
      smart_service/apis/app_user_login.py
  2. 31
      smart_service/apis/support.py

4
smart_service/apis/app_user_login.py

@ -869,11 +869,7 @@ def refresh_token():
refresh_token= req['refresh_token'] refresh_token= req['refresh_token']
if refresh_token: if refresh_token:
device_id= req['DeviceID'] device_id= req['DeviceID']
# frappe.log_error('')
# req = json.loads(frappe.request.data)
# ref_token = req['refresh_token']
ref_token = refresh_token ref_token = refresh_token
doc_details = frappe.db.sql(''' doc_details = frappe.db.sql('''
SELECT * FROM `tabRefresh Token`;''', as_dict=1) SELECT * FROM `tabRefresh Token`;''', as_dict=1)
try: try:

31
smart_service/apis/support.py

@ -412,15 +412,14 @@ def set_procedure_false():
@frappe.whitelist(allow_guest=1) @frappe.whitelist(allow_guest=1)
def clear_procedures(): def clear_procedures():
try: try:
pass set_procedure_false()
# set_procedure_false() frappe.db.sql('''delete FROM `tabPublish`;''')
# frappe.db.sql('''delete FROM `tabPublish`;''') frappe.db.sql('''delete FROM `tabPublish_Docs`;''')
# frappe.db.sql('''delete FROM `tabPublish_Docs`;''')
frappe.db.sql('''update `tabVariant Mapping_Assets` set published=0;''')
# frappe.db.sql('''update `tabVariant Mapping_Assets` set published=0;''') frappe.db.sql('''update `tabSystem Mapping_Sub System` set procedure_is_published=0;''')
# frappe.db.sql('''update `tabSystem Mapping_Sub System` set procedure_is_published=0;''') frappe.db.sql('''update `tabSystem Mapping_System Assets` set published=0;''')
# frappe.db.sql('''update `tabSystem Mapping_System Assets` set published=0;''') frappe.db.commit()
# frappe.db.commit()
except Exception as e: except Exception as e:
return e return e
@ -444,4 +443,16 @@ def get_kms_mapping(sub_system,variant,language):
FROM `tabKilometer Mapping_Items` where sub_systems="{sub_system}" and parent LIKE "{varKMS}" order by kilometer_IDX;''',as_dict=1) FROM `tabKilometer Mapping_Items` where sub_systems="{sub_system}" and parent LIKE "{varKMS}" order by kilometer_IDX;''',as_dict=1)
return data return data
except Exception as e: except Exception as e:
return e return e
@frappe.whitelist(allow_guest=1)
def remove_html_tags():
try:
frappe.db.sql('''update tabProcedure_Details set content= replace(content,'>','>'); ''')
frappe.db.sql('''update tabProcedure_Details set content= replace(content,'&lt;','<'); ''')
frappe.db.sql('''update tabProcedure_Details set content= replace(content,'<div class="ql-editor read-mode"><p>',''); ''')
frappe.db.sql('''update tabProcedure_Details set content= replace(content,'</p></div>',''); ''')
frappe.db.commit()
return True, 'Done'
except Exception as e:
return False,e
Loading…
Cancel
Save