Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Update models.py #138

wants to merge 1 commit into from

Conversation

Shubham0324
Copy link

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.

@Shubham0324
Copy link
Author

@CoreyMSchafer If this code is correct and is accepted kindly mention (hacktoberfest-accepted) label to the PR.
Thank You

Copy link

@StupidRepo StupidRepo left a comment

Choose a reason for hiding this comment

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

noooo

Comment on lines 10 to 21
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)

Choose a reason for hiding this comment

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

no

Copy link
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?

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
Author

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()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants