Skip to content

Commit d2fec4e

Browse files
committed
Remove "Use original image" (use_no_cropping) option from image plugin, and purge ocurrences
1 parent 89d0e9c commit d2fec4e

File tree

4 files changed

+1
-16
lines changed

4 files changed

+1
-16
lines changed

djangocms_frontend/contrib/image/cms_plugins.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ class ImagePlugin(
7575
{
7676
"classes": ("collapse",),
7777
"fields": (
78-
("use_no_cropping"),
7978
("use_crop", "use_upscale"),
8079
"thumbnail_options",
8180
),

djangocms_frontend/contrib/image/forms.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ class Meta:
7575
"alignment",
7676
"link_attributes",
7777
"use_crop",
78-
"use_no_cropping",
7978
"use_upscale",
8079
"use_responsive_image",
8180
"thumbnail_options",
@@ -139,13 +138,6 @@ class Meta:
139138
help_text=_("Attributes apply to the <b>link</b>."),
140139
)
141140

142-
# ignores all other cropping options
143-
# throws validation error if other cropping options are selected
144-
use_no_cropping = forms.BooleanField(
145-
label=_("Use original image"),
146-
required=False,
147-
help_text=_("Outputs the raw image without cropping."),
148-
)
149141
# upscale and crop work together
150142
# throws validation error if other cropping options are selected
151143
use_crop = forms.BooleanField(
@@ -207,9 +199,6 @@ def clean(self):
207199
# certain cropping options do not work together, the following
208200
# list defines the disallowed options used in the ``clean`` method
209201
invalid_option_pairs = [
210-
("use_no_cropping", "use_crop"),
211-
("use_no_cropping", "use_upscale"),
212-
("use_no_cropping", "thumbnail_options"),
213202
("thumbnail_options", "use_crop"),
214203
("thumbnail_options", "use_upscale"),
215204
]

djangocms_frontend/contrib/image/image_save.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def create_image_plugin(filename, file, parent_plugin, **kwargs):
2929
img.config.update(
3030
{
3131
"picture": {"pk": image_obj.pk, "model": "filer.image"},
32-
"use_no_cropping": True,
32+
"use_no_cropping": True, # ask
3333
}
3434
)
3535
add_plugin(parent_plugin.placeholder, img)

djangocms_frontend/contrib/image/models.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,6 @@ def img_src(self):
120120
# in this case we want to return an empty string to avoid #69
121121
elif not self.picture:
122122
return ""
123-
# return the original, unmodified image
124-
elif self.use_no_cropping:
125-
return self.rel_image.url if self.rel_image else ""
126123

127124
picture_options = self.get_size(
128125
width=self.width or 0,

0 commit comments

Comments
 (0)