Skip to content

Commit

Permalink
Prepare release 1.0.6
Browse files Browse the repository at this point in the history
  • Loading branch information
axnsan12 committed Dec 23, 2017
1 parent 313d122 commit 73adc49
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
11 changes: 11 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,17 @@ Changelog
#########


*********
**1.0.6**
*********

- **FIXED:** Swagger UI "Try it out!" should now work with Django login
- **FIXED:** callable ``default`` values on serializer fields will now be properly called (:pr:`24`, :issue:`25`)
- **IMPROVED:** updated ``swagger-ui`` to version 3.8.0
- **IMPROVED:** ``PrimaryKeyRelatedField`` and ``SlugRelatedField`` will now have
appropriate types based on the related model (:pr:`26`)
- **IMPROVED:** mock views will now have a bound request even with ``public=False`` (:pr:`23`)

*********
**1.0.5**
*********
Expand Down
8 changes: 4 additions & 4 deletions src/drf_yasg/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ def inspect_model_field(model, model_field):
if isinstance(model_field, model_field_class):
swagger_type, format = tf
break
else:
else: # pragma: no cover
swagger_type, format = None, None

if format is None or format == openapi.FORMAT_SLUG:
Expand Down Expand Up @@ -274,7 +274,7 @@ def SwaggerType(existing_object=None, **instance_kwargs):
if hasattr(default, 'set_context'):
default.set_context(field)
default = default()
except Exception as e:
except Exception as e: # pragma: no cover
logger.warning("default for %s is callable but it raised an exception when "
"called; 'default' field will not be added to schema", field, exc_info=True)
default = None
Expand All @@ -285,7 +285,7 @@ def SwaggerType(existing_object=None, **instance_kwargs):
# JSON roundtrip ensures that the value is valid JSON;
# for example, sets get transformed into lists
default = json.loads(json.dumps(default, cls=encoders.JSONEncoder))
except Exception:
except Exception: # pragma: no cover
logger.warning("'default' on schema for %s will not be set because "
"to_representation raised an exception", field, exc_info=True)
default = None
Expand Down Expand Up @@ -367,7 +367,7 @@ def make_schema_definition():
try:
model = field.queryset.model
pk_field = model._meta.pk
except Exception:
except Exception: # pragma: no cover
logger.warning("an exception was raised when attempting to extract the primary key related to %s; "
"falling back to plain string" % field, exc_info=True)
else:
Expand Down

0 comments on commit 73adc49

Please sign in to comment.