changes in article update api and get image url method

This commit is contained in:
abutalib-kiwi
2023-08-02 11:16:12 +05:30
parent d3564efbb9
commit af121f5a53
2 changed files with 8 additions and 2 deletions

View File

@ -16,7 +16,9 @@ def pop_id(data):
def get_image_url(data):
if 'image' in data and data['image'] is not None:
if 'image_url' in data:
return data['image_url']
elif 'image' in data and data['image'] is not None:
image = data.pop('image')
filename = f"{ARTICLE_CARD_IMAGE_FOLDER}/{image.name}"
# upload image on ali baba