Skip to content

Commit

Permalink
fix an unnecessary nested if
Browse files Browse the repository at this point in the history
  • Loading branch information
Ksauder committed Sep 21, 2024
1 parent 74a918c commit 78f06eb
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions ninja/orm/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,8 @@ def convert_django_fields(
raise ConfigError("Only one of 'fields' or 'exclude' should be set.")

model_fields_list = list(self._selected_model_fields(model, fields, exclude))
if optional_fields:
if optional_fields == "__all__":
optional_fields = [f.name for f in model_fields_list]
if optional_fields and optional_fields == "__all__":
optional_fields = [f.name for f in model_fields_list]

definitions = {}
for fld in model_fields_list:
Expand Down

0 comments on commit 78f06eb

Please sign in to comment.