Skip to content
Permalink
Browse files

Use CloudinaryField directly since we can now pass options (#4126)

Co-authored-by: Pomax <pomax@nihongoresources.com>
  • Loading branch information
patjouk and Pomax committed Jan 14, 2020
1 parent d77fcdd commit 4da8eadfb0613f9c2acbc74e4bf1da1dd9daa3de
@@ -0,0 +1,19 @@
# Generated by Django 2.2.9 on 2020-01-13 15:14

import cloudinary.models
from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('buyersguide', '0033_uplift_app_device_fields'),
]

operations = [
migrations.AlterField(
model_name='product',
name='cloudinary_image',
field=cloudinary.models.CloudinaryField(blank=True, help_text='Image representing this product - hosted on Cloudinary', max_length=255, verbose_name='image'),
),
]
@@ -36,6 +36,7 @@ def get_product_image_upload_path(instance, filename):


# Override the default 'public_id' to upload all images to the buyers guide directory on Cloudinary
# TODO: this is not needed anymore and needs to be removed.
class CloudinaryImageField(CloudinaryField):
def upload_options(self, model_instance):
return {
@@ -194,10 +195,12 @@ def is_current(self):
blank=True,
)

cloudinary_image = CloudinaryImageField(
cloudinary_image = CloudinaryField(
help_text='Image representing this product - hosted on Cloudinary',
blank=True,
verbose_name='image',
folder='foundationsite/buyersguide',
use_filename=True
)

meets_minimum_security_standards = models.BooleanField(

0 comments on commit 4da8ead

Please sign in to comment.
You can’t perform that action at this time.