Skip to content

Update models.py#138

Open
Shubham0324 wants to merge 1 commit intoCoreyMSchafer:masterfrom
Shubham0324:master
Open

Update models.py#138
Shubham0324 wants to merge 1 commit intoCoreyMSchafer:masterfrom
Shubham0324:master

Conversation

@Shubham0324
Copy link
Copy Markdown

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
Copy Markdown
Author

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

Copy link
Copy Markdown

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

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.

3 participants