[Answer]-How to solve a DeprecationWarning I get after customizing the user profile?

1๐Ÿ‘

โœ…

As stated in docs the deprecation warning in favor of def signup(self, request, user):

Previously, the save(user) was called on the custom signup form.
However, this shadowed the existing save method in case a model form
was used. To avoid confusion, the save method has been deprecated in
favour of a def signup(request, user) method.

So just implement the method. And do what ever you were doing in def save() in def signup() There is no need of def save().

def signup(self, request, user):
    user.first_name = self.cleaned_data['first_name']
    user.last_name = self.cleaned_data['last_name']
    user.save()
๐Ÿ‘คAamir Rind

Leave a comment