Skip to content

Commit 0629e1d

Browse files
committed
remove unused method BrowserView.crop()
1 parent 56c9e83 commit 0629e1d

File tree

2 files changed

+0
-18
lines changed

2 files changed

+0
-18
lines changed

finder/browser/urls.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,6 @@
3838
'<uuid:file_id>/change',
3939
BrowserView.as_view(action='change'),
4040
),
41-
path(
42-
'<uuid:image_id>/crop',
43-
BrowserView.as_view(action='crop'),
44-
),
4541
path(
4642
'jsi18n/',
4743
JavaScriptCatalog.as_view(packages=['finder']),

finder/browser/views.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -259,17 +259,3 @@ def change(self, request, file_id):
259259
else:
260260
return {'form_html': mark_safe(strip_spaces_between_tags(form.as_div()))}
261261

262-
@method_decorator(require_POST)
263-
def crop(self, request, image_id):
264-
image = FileModel.objects.get_inode(id=image_id, mime_types=['image/*'], is_folder=False)
265-
width, height = int(request.POST.get('width')), int(request.POST.get('height'))
266-
cropped_image_path = image.get_cropped_path(width, height)
267-
if not default_storage.exists(cropped_image_path):
268-
image.crop(cropped_image_path, width, height)
269-
return {
270-
'image_id': image_id,
271-
'cropped_image_url': default_storage.url(cropped_image_path),
272-
'width': width,
273-
'height': height,
274-
'meta_data': image.get_meta_data(),
275-
}

0 commit comments

Comments
 (0)