|
@@ -607,10 +607,11 @@ class DeviceManagement(View):
|
|
|
try:
|
|
|
with transaction.atomic():
|
|
|
if icon or iconV2:
|
|
|
+ app_device_type = AppDeviceType.objects.filter(id=app_device_type_id).first()
|
|
|
bucket_name = 'ansjerfilemanager'
|
|
|
s3 = AmazonS3Util(AWS_ACCESS_KEY_ID[1], AWS_SECRET_ACCESS_KEY[1], AWS_SES_ACCESS_REGION)
|
|
|
- icon_path = ""
|
|
|
- icon_v2_path = ""
|
|
|
+ icon_path = app_device_type.icon
|
|
|
+ icon_v2_path = app_device_type.iconV2
|
|
|
if icon:
|
|
|
icon_path = f'https://ansjerfilemanager.s3.amazonaws.com/app/device_type_images/{now_time}_{icon.name}'
|
|
|
file_key = f'app/device_type_images/{now_time}_{icon.name}'
|
|
@@ -678,11 +679,12 @@ class DeviceManagement(View):
|
|
|
return response.json(444)
|
|
|
try:
|
|
|
with transaction.atomic():
|
|
|
+ app_device_type = AppDeviceType.objects.filter(id=app_device_type_id).first()
|
|
|
if icon or iconV2:
|
|
|
bucket_name = 'ansjerfilemanager'
|
|
|
s3 = AmazonS3Util(AWS_ACCESS_KEY_ID[1], AWS_SECRET_ACCESS_KEY[1], AWS_SES_ACCESS_REGION)
|
|
|
- icon_path = ""
|
|
|
- icon_v2_path = ""
|
|
|
+ icon_path = app_device_type.icon
|
|
|
+ icon_v2_path = app_device_type.iconV2
|
|
|
if icon:
|
|
|
icon_path = f'https://ansjerfilemanager.s3.amazonaws.com/app/device_type_images/{now_time}_{icon.name}'
|
|
|
file_key = f'app/device_type_images/{now_time}_{icon.name}'
|
|
@@ -706,8 +708,7 @@ class DeviceManagement(View):
|
|
|
return response.json(444, 'config必须是一个json数据')
|
|
|
AppDeviceType.objects.filter(id=app_device_type_id) \
|
|
|
.update(model=model, type=type, icon=icon_path, iconV2=icon_v2_path,
|
|
|
- app_version_number_id=version_number,
|
|
|
- config=config)
|
|
|
+ app_version_number_id=version_number, config=config)
|
|
|
else:
|
|
|
AppDeviceType.objects.filter(id=app_device_type_id) \
|
|
|
.update(model=model, type=type, icon=icon_path, iconV2=icon_v2_path,
|