Fix image url
This commit is contained in:
parent
4f67c295d1
commit
ea830379fc
|
|
@ -18,11 +18,11 @@ class Command(BaseCommand):
|
||||||
AND scope = 'public'
|
AND scope = 'public'
|
||||||
AND type = 'Photo'
|
AND type = 'Photo'
|
||||||
AND menu_id IS NULL
|
AND menu_id IS NULL
|
||||||
GROUP BY establishment_id, establishment_assets.id, establishment_id, attachment_suffix_url;'''
|
GROUP BY establishment_assets.id, establishment_id, attachment_suffix_url;'''
|
||||||
)
|
)
|
||||||
queryset = [vars(query) for query in raw_qs]
|
queryset = [vars(query) for query in raw_qs]
|
||||||
for obj in queryset:
|
for obj in queryset:
|
||||||
establishment = Establishment.objects.filter(old_id=obj['establishment_id']).first()
|
establishment = Establishment.objects.filter(old_id=obj['establishment_id'], image_url__isnull=True).first()
|
||||||
if establishment:
|
if establishment:
|
||||||
img = url + obj['attachment_suffix_url']
|
img = url + obj['attachment_suffix_url']
|
||||||
img_url = img[:-12]
|
img_url = img[:-12]
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user