From 002e67295253a5a1433811463c23558fa25d603d Mon Sep 17 00:00:00 2001 From: Paul Melnikow Date: Thu, 2 Jan 2014 16:50:00 -0500 Subject: [PATCH] Invoke super from UpdateModelMixin.pre_save Allows a subclass of GenericAPIView to add its own pre_save logic which will affect CreateMixin, but once UpdateMixin is added it isn't called. Since GenericAPIView has an empty implementation of pre_save, calling it on super should be safe. --- rest_framework/mixins.py | 1 + 1 file changed, 1 insertion(+) diff --git a/rest_framework/mixins.py b/rest_framework/mixins.py index 43950c4bf..114ad4f10 100644 --- a/rest_framework/mixins.py +++ b/rest_framework/mixins.py @@ -163,6 +163,7 @@ class UpdateModelMixin(object): """ Set any attributes on the object that are implicit in the request. """ + super(UpdateModelMixin, self).pre_save(obj) # pk and/or slug attributes are implicit in the URL. lookup_url_kwarg = self.lookup_url_kwarg or self.lookup_field lookup = self.kwargs.get(lookup_url_kwarg, None)