diff --git a/seed/lib/superperms/orgs/permissions.py b/seed/lib/superperms/orgs/permissions.py index 14b9d41e96..c79a277230 100644 --- a/seed/lib/superperms/orgs/permissions.py +++ b/seed/lib/superperms/orgs/permissions.py @@ -205,7 +205,7 @@ def has_permission(self, request, view): value_error = False try: if hasattr(view, 'get_queryset'): - queryset = view.get_queryset() + queryset = view.get_queryset else: queryset = getattr(view, 'queryset', None) except ValueError: diff --git a/seed/views/v3/meter_readings.py b/seed/views/v3/meter_readings.py index e3e6f37604..8b74103559 100644 --- a/seed/views/v3/meter_readings.py +++ b/seed/views/v3/meter_readings.py @@ -62,6 +62,7 @@ def perform_create(self, serializer): """On create, make sure to add in the property id which comes from the URL kwargs.""" # check permissions? + self.meter_pk = self.kwargs.get('meter_pk', None) if self.meter_pk: serializer.save(meter_id=self.meter_pk) else: diff --git a/seed/views/v3/meters.py b/seed/views/v3/meters.py index 72ca8519b2..26f7e69be6 100644 --- a/seed/views/v3/meters.py +++ b/seed/views/v3/meters.py @@ -40,6 +40,7 @@ def get_queryset(self): def perform_create(self, serializer): """On create, make sure to add in the property id which comes from the URL kwargs.""" + self.property_pk = self.kwargs.get('property_pk', None) # check permissions? if self.property_pk: serializer.save(property_id=self.property_pk)