set creator when creating slice in tenant view
Scott Baker [Mon, 19 Jan 2015 16:56:16 +0000 (08:56 -0800)]
planetstack/core/xoslib/methods/tenantview.py
planetstack/core/xoslib/static/js/xosTenant.js

index 6c84b3e..d7460da 100644 (file)
@@ -80,6 +80,7 @@ def getTenantViewDict(user):
             "current_user_site_users": [auser.id for auser in site_users],
             "current_user_site_user_names": [auser.email for auser in site_users],
             "current_user_can_create_slice": user.is_admin or ("pi" in user_site_roles) or ("admin" in user_site_roles),
+            "current_user_id": user.id,
             }
 
 class TenantList(APIView):
index 9c45460..0ab8e81 100644 (file)
@@ -183,11 +183,12 @@ XOSTenantApp.addSlice = function() {
     }\r
 \r
     model = new xos.slicesPlus.model({site: xos.tenant().current_user_site_id,\r
-                                      name: xos.tenant().current_user_login_base + "_"});\r
+                                      name: xos.tenant().current_user_login_base + "_",\r
+                                      creator: xos.tenant().current_user_id});\r
     console.log(model);\r
     var detailView = new XOSTenantApp.tenantAddView({model: model,\r
-                                                    collection: xos.slicesPlus,\r
-                                                    noSubmitButton: true,\r
+                                                     collection: xos.slicesPlus,\r
+                                                     noSubmitButton: true,\r
                                                     });\r
     detailView.dialog = $("#tenant-addslice-dialog");\r
     app.tenantAddSliceInterior.show(detailView);\r