Skip to content

Commit

Permalink
bugfix save parameter removal #212
Browse files Browse the repository at this point in the history
  • Loading branch information
tfranzel committed Jan 24, 2021
1 parent 8e7dab7 commit f23de89
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion drf_spectacular/openapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,8 @@ def dict_helper(parameters):
}
# override/add @extend_schema parameters
for key in excluded_parameters:
del parameters[key]
if key in parameters:
del parameters[key]
for key, parameter in override_parameters.items():
parameters[key] = parameter

Expand Down
5 changes: 4 additions & 1 deletion tests/test_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,10 @@ class AllFields(models.Model):
field_smallint = models.SmallIntegerField()
field_posint = models.PositiveIntegerField()
field_possmallint = models.PositiveSmallIntegerField()
field_nullbool = models.NullBooleanField()
if DJANGO_VERSION > '3.1':
field_nullbool = models.BooleanField(null=True)
else:
field_nullbool = models.NullBooleanField()
field_time = models.TimeField()
field_duration = models.DurationField()

Expand Down

0 comments on commit f23de89

Please sign in to comment.