CodeQL complaints about "Missing call to __init__
during object initialization" in inherited ModelSerializer class.
#9184
Unanswered
afrischk
asked this question in
Question & Answer
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Code of this example of a
DynamicFieldsModelSerializer
taken from the docs.CodeQL complaints about 'Class DynamicFieldsModelSerializer may not be initialized properly as
method.Field.__init__
is not called from its__init__
method.What is the correct way to initialize the base classes here?
Call them (all -
BaseSerializer
,Field
) explicit?Omit the
super()
call at all?Beta Was this translation helpful? Give feedback.
All reactions