__init__
PYL-W0201 72 def save(self, request):
73 adapter = get_adapter()
74 user = adapter.new_user(request)
75 self.cleaned_data = self.get_cleaned_data() 76 user = adapter.save_user(request, user, self, commit=False)
77 if "password1" in self.cleaned_data:
78 try:
Defining an instance attribute outside __init__
affects the readability of code. It is expected to find all the attributes an instance may have by reading its __init__
method. If there is a need to initialize attribute via sub-initialization methods, it is recommended to assign attributes to None
in the init then call the sub-initialization methods.