New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update models.py #138
base: master
Are you sure you want to change the base?
Update models.py #138
Conversation
@CoreyMSchafer If this code is correct and is accepted kindly mention (hacktoberfest-accepted) label to the PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
noooo
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does no means?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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()
TypeError - save() got an unexpected keyword argument 'force_insert'
The error was occurring with initial def save(...)... method
User Profile Was Created and Saved but It showed the above error when Signing Up
But with these change the app is working fine and was redirected to Login Page with no error.