Browse Source

Check all vehcile update api fix- remove log error

version2
venkataakhil 1 year ago
parent
commit
e34a2612fd
  1. 23
      smart_service/apis/update_validation.py

23
smart_service/apis/update_validation.py

@ -166,7 +166,7 @@ def check_all_vehicle_updates1(vehicle_list=None):
@frappe.whitelist() @frappe.whitelist()
def check_all_vehicle_updates(vehicle_list=None): def check_all_vehicle_updates(vehicle_list=None):
frappe.log_error('request' + str(vehicle_list)) # frappe.log_error('request' + str(vehicle_list))
rate_res = custom_rate_limit(limit=5, seconds=15) rate_res = custom_rate_limit(limit=5, seconds=15)
if rate_res != 1: if rate_res != 1:
return rate_res return rate_res
@ -186,8 +186,8 @@ def check_all_vehicle_updates(vehicle_list=None):
vehicle_data = v_list['VehicleReqList'] vehicle_data = v_list['VehicleReqList']
publish_type = frappe.db.sql( publish_type = frappe.db.sql(
'''SELECT publish_type FROM `tabApp Device` where name='{}';'''.format(iid), as_list=1) '''SELECT publish_type FROM `tabApp Device` where name='{}';'''.format(iid), as_list=1)
frappe.log_error('publish_type' + str(publish_type)) # frappe.log_error('publish_type' + str(publish_type))
frappe.log_error('iid' + str(iid)) # frappe.log_error('iid' + str(iid))
if publish_type[0][0] is not None: if publish_type[0][0] is not None:
if vehicle_data: if vehicle_data:
for v in vehicle_data: for v in vehicle_data:
@ -240,7 +240,7 @@ def check_all_vehicle_updates(vehicle_list=None):
pass pass
elif publish_type[0][0] == "Internal": elif publish_type[0][0] == "Internal":
frappe.log_error(str('check_ful_internal')) # frappe.log_error(str('check_ful_internal'))
if current_version == float(data1[0]['version']): if current_version == float(data1[0]['version']):
data1[0][UPDATE_AVAILABLE] = "false" data1[0][UPDATE_AVAILABLE] = "false"
vehicle_req_list.append(data1) vehicle_req_list.append(data1)
@ -249,9 +249,8 @@ def check_all_vehicle_updates(vehicle_list=None):
data = frappe.db.sql('''SELECT name,format(max(version),2) as version,vehicle_id,language,release_description as description FROM `tabPublish` where vehicle='{}' and language='{}' data = frappe.db.sql('''SELECT name,format(max(version),2) as version,vehicle_id,language,release_description as description FROM `tabPublish` where vehicle='{}' and language='{}'
and publish_status='Published' and publish_type='Internal' and vehicle_status='Active' and version > '{}' and publish_module='Automotive System' and publish_status='Published' and publish_type='Internal' and vehicle_status='Active' and version > '{}' and publish_module='Automotive System'
order by version ASC;'''.format(v_id, lang, current_version), as_dict=1) order by version ASC;'''.format(v_id, lang, current_version), as_dict=1)
# 22.06 # frappe.log_error(
frappe.log_error( # 'check_ful_inter' + str(data))
'check_ful_inter' + str(data))
publish_dec = frappe.db.sql('''SELECT name,format(max(version),2) as version,vehicle_id,language,release_description as description FROM `tabPublish` where vehicle='{}' and language='{}' publish_dec = frappe.db.sql('''SELECT name,format(max(version),2) as version,vehicle_id,language,release_description as description FROM `tabPublish` where vehicle='{}' and language='{}'
# and publish_status='Published' and publish_type='Internal' and vehicle_status='Active' and version = '{}' and publish_module='Automotive System' # and publish_status='Published' and publish_type='Internal' and vehicle_status='Active' and version = '{}' and publish_module='Automotive System'
# order by version ASC;'''.format(v_id, lang, data1_global[0]['version']), as_dict=1) # order by version ASC;'''.format(v_id, lang, data1_global[0]['version']), as_dict=1)
@ -261,15 +260,15 @@ def check_all_vehicle_updates(vehicle_list=None):
data = frappe.db.sql('''SELECT name,format(max(version),2) as version,vehicle_id,language,release_description as description FROM `tabPublish` where vehicle='{}' and data = frappe.db.sql('''SELECT name,format(max(version),2) as version,vehicle_id,language,release_description as description FROM `tabPublish` where vehicle='{}' and
language='{}' and publish_status='Published' and publish_type='{}' and vehicle_status='Active' and version > '{}' and publish_module='Automotive System' language='{}' and publish_status='Published' and publish_type='{}' and vehicle_status='Active' and version > '{}' and publish_module='Automotive System'
order by version ASC;'''.format(v_id, lang, publish_type[0][0], current_version), as_dict=1) order by version ASC;'''.format(v_id, lang, publish_type[0][0], current_version), as_dict=1)
frappe.log_error( # frappe.log_error(
'check_ful_inter_else' + str(data)) # 'check_ful_inter_else' + str(data))
publish_dec = frappe.db.sql('''SELECT name,format(max(version),2) as version,vehicle_id,language,release_description as description FROM `tabPublish` where vehicle='{}' and language='{}' publish_dec = frappe.db.sql('''SELECT name,format(max(version),2) as version,vehicle_id,language,release_description as description FROM `tabPublish` where vehicle='{}' and language='{}'
and publish_status='Published' and publish_type='Global' and vehicle_status='Active' and version ='{}' and publish_module='Automotive System' and publish_status='Published' and publish_type='Global' and vehicle_status='Active' and version ='{}' and publish_module='Automotive System'
order by version ASC;'''.format(v_id, lang, data1[0]['version']), as_dict=1) order by version ASC;'''.format(v_id, lang, data1[0]['version']), as_dict=1)
# return data # return data
else: # else:
frappe.log_error( # frappe.log_error(
'check_ful_inter_else') # 'check_ful_inter_else')
data_append = [] data_append = []
rd = [] rd = []
try: try:

Loading…
Cancel
Save