diff options
| author | Tom Christie | 2012-12-18 18:21:58 +0000 |
|---|---|---|
| committer | Tom Christie | 2012-12-18 18:21:58 +0000 |
| commit | 6693d2d277823c9150077c7c9534b7550dfd192c (patch) | |
| tree | e7f547a95cc152a8a809ab39595c3008d2e16c1e /rest_framework/mixins.py | |
| parent | 8f23b7f2f901751ecb79e98a540d3a8dc83b0d1a (diff) | |
| download | django-rest-framework-6693d2d277823c9150077c7c9534b7550dfd192c.tar.bz2 | |
Fix for pks returning as strings when set in pre_save. Fixes #482. Thanks to @n8agrin for the bug report.
Diffstat (limited to 'rest_framework/mixins.py')
| -rw-r--r-- | rest_framework/mixins.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/rest_framework/mixins.py b/rest_framework/mixins.py index 1edcfa5c..8dc0c329 100644 --- a/rest_framework/mixins.py +++ b/rest_framework/mixins.py @@ -113,6 +113,10 @@ class UpdateModelMixin(object): slug_field = self.get_slug_field() setattr(obj, slug_field, slug) + # Ensure we clean the attributes so that we don't eg return integer + # pk using a string representation, as provided by the url conf kwarg. + obj.full_clean() + class DestroyModelMixin(object): """ |
