Skip to content
Snippets Groups Projects
Verified Commit d93ab03a authored by Ernesto Rico Schmidt's avatar Ernesto Rico Schmidt
Browse files

feat: remove save and delete Image methods

parent b5c7f0c6
No related branches found
No related tags found
No related merge requests found
......@@ -21,7 +21,6 @@
from rest_framework.exceptions import ValidationError
from versatileimagefield.fields import PPOIField, VersatileImageField
from django.conf import settings
from django.contrib.auth.models import User
from django.db import models
from django.db.models import Max, Q
......@@ -157,19 +156,6 @@ class Image(models.Model):
height = int(width / aspect_ratio)
return self.image.thumbnail[f"{width}x{height}"].url
def save(self, *args, **kwargs):
super().save(*args, **kwargs)
if self.image.name and settings.THUMBNAIL_SIZES:
for size in settings.THUMBNAIL_SIZES:
self.image.thumbnail = self.image.crop[size].name
def delete(self, using=None, keep_parents=False):
self.image.delete_all_created_images()
self.image.delete(save=False)
super().delete(using, keep_parents)
class Host(models.Model):
biography = models.TextField(blank=True)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment