attach caller to saved objects/models
diff --git a/planetstack/apigen/api.template.py b/planetstack/apigen/api.template.py
index 393f142..84f7613 100644
--- a/planetstack/apigen/api.template.py
+++ b/planetstack/apigen/api.template.py
@@ -62,6 +62,7 @@
def create(self, request, *args, **kwargs):
#obj = {{ object.camel }}().update(request.DATA)
obj = self.get_object()
+ obj.caller = request.user
if obj.can_update(request.user):
return super({{ object.camel }}List, self).create(request, *args, **kwargs)
else:
diff --git a/planetstack/core/admin.py b/planetstack/core/admin.py
index 996e22d..2a77f3f 100644
--- a/planetstack/core/admin.py
+++ b/planetstack/core/admin.py
@@ -422,6 +422,7 @@
save_on_top = False
def save_model(self, request, obj, form, change):
+ obj.caller = request.user
# update openstack connection to use this site/tenant
obj.save_by_user(request.user)