Permalink
Browse files

self.object is only set when super's create() succeeds.

  • Loading branch information...
1 parent 17ec45e commit 7aba6364d47d088d0e48877e1ec65b85cb5831d5 @markotibold markotibold committed Nov 13, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 fiber/rest_api/views.py
View
@@ -32,7 +32,8 @@
class FiberListCreateAPIView(generics.ListCreateAPIView):
def create(self, request, *args, **kwargs):
response = super(FiberListCreateAPIView, self).create(request, *args, **kwargs)
- PERMISSIONS.object_created(request.user, self.object)
+ if hasattr(self, 'object'):
+ PERMISSIONS.object_created(request.user, self.object)
return response

0 comments on commit 7aba636

Please sign in to comment.