Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ class Profile(models.Model):
def __str__(self):
return f'{self.user.username} Profile'

def save(self):
super().save()
def save(self, *args, **kwargs):
super(Profile, self).save(*args, **kwargs)

img = Image.open(self.image.path)

if img.height > 300 or img.width > 300:
output_size = (300, 300)
output_size = (300,300)
img.thumbnail(output_size)
img.save(self.image.path)
Comment on lines 10 to 21
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does no means?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we enter an already registered usernme it showing an error again

Copy link
Copy Markdown
Author

@Shubham0324 Shubham0324 Apr 25, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For that you can create a check if already exist showError()