Merge branch 'onelab' of ssh://git.onelab.eu/git/myslice into onelab
authorLoic Baron <loic.baron@lip6.fr>
Tue, 6 May 2014 16:20:16 +0000 (18:20 +0200)
committerLoic Baron <loic.baron@lip6.fr>
Tue, 6 May 2014 16:20:16 +0000 (18:20 +0200)
portal/templates/slice-tab-users-view.html
rest/__init__.py

index e1b0618..fb49615 100644 (file)
@@ -31,6 +31,9 @@
                        <th>Enabled</th>
                        </tr>
                </table>
+
+                <!-- XXX TODO: for the moment only PIs have access to Update but users that have slice credentials should also have access to that -->
+
                                {% if 'is_pi'  in pi %}
                                <button id="addusers" type="button" class="btn btn-default"><span class="glyphicon glyphicon-ok"></span> Update users</button>
                                {%endif%}
                 });
            
                }); // post rest/user
-
                $('button#addusers').click(function() {
                 $.post("/update/slice/",{'filters':{'slice_hrn':'{{slice}}'},'params':{'users':slice_users}}, function(data) {
                     console.log(data);
                        if(data.success){
                        // TODO: highlight row after success
                        //$('tr[id="'+record_id+'"]').highlight();
+                       mysliceAlert("Success: slice updated",'success');
                        }else{
-                       alert("Rest Error for: "+data.error);
+                       mysliceAlert("Rest Error for: "+data.error,'warning');
                        }
                 }); // post update slice
             
index faef22e..1ca3797 100644 (file)
@@ -153,7 +153,7 @@ class ObjectRequest(object):
         if self.filters :
             query.set(self.filters)
         else:
-            raise Exception, "Filters are required for update"
+            raise Exception, "Filters are required for delete"
         return execute_query(self.request, query)
     
     def json(self):