Closed nsidnev closed 4 years ago
This might be an issue with django models as well:
class Post(models.Model):
slug = models.CharField(...)
def save(self, *args, **kwargs):
self.slug = generate_slug(self)
Looks like the only valid solution is to switch this rule off if you are using django
, pydantic
, etc.
Bug report
What's wrong
This code (actually just modified example from the python docs) produces a false positive WPS601 error:
How is that should be
Well, since this is a dataclass, it seems to me that this error shouldn't occur here.
NOTE: in fact, I am not using python dataclasses, but pydantic dataclasses, but in both cases an error can be reproduced. But if possible, then I'd like that in the case of pydantic usage this error also did not occur.
System information
flake8 information
Contents of
flake8 --bug-report
:pip information
Contents of
pip freeze
: