incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tvansteenbu...@apache.org
Subject [45/50] git commit: [#6392] ticket:444 added ajax to unblock user
Date Thu, 26 Sep 2013 18:30:03 GMT
[#6392] ticket:444 added ajax to unblock user


Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/2a570132
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/2a570132
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/2a570132

Branch: refs/heads/tv/6612
Commit: 2a570132fac1dc851b036befbf89fc0846e3f3ef
Parents: 83903bb
Author: coldmind <sokandpal@yandex.ru>
Authored: Thu Sep 19 14:18:29 2013 +0300
Committer: Tim Van Steenburgh <tvansteenburgh@gmail.com>
Committed: Tue Sep 24 17:36:25 2013 +0000

----------------------------------------------------------------------
 Allura/allura/app.py                               | 6 +++---
 Allura/allura/templates/app_admin_permissions.html | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/2a570132/Allura/allura/app.py
----------------------------------------------------------------------
diff --git a/Allura/allura/app.py b/Allura/allura/app.py
index b88f23a..d172a65 100644
--- a/Allura/allura/app.py
+++ b/Allura/allura/app.py
@@ -600,7 +600,8 @@ class DefaultAdminController(BaseController):
 
     @validate(dict(user_id=V.Set(),
                    perm=V.UnicodeString()))
-    @expose()
+    @expose('json:')
+    @require_post()
     def unblock_user(self, user_id=None, perm=None):
         try:
             user_id = map(ObjectId, user_id)
@@ -608,8 +609,7 @@ class DefaultAdminController(BaseController):
             user_id = []
         users = model.User.query.find({'_id': {'$in': user_id}}).all()
         if not users:
-            flash('Select user to unblock', 'error')
-            redirect(request.referer)
+            return dict(error='Select user to unblock')
         for user in users:
             ace = model.ACE.deny(user.project_role()._id, perm)
             ace = model.ACL.contains(ace, self.app.acl)

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/2a570132/Allura/allura/templates/app_admin_permissions.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/app_admin_permissions.html b/Allura/allura/templates/app_admin_permissions.html
index 96471d4..fb5aa61 100644
--- a/Allura/allura/templates/app_admin_permissions.html
+++ b/Allura/allura/templates/app_admin_permissions.html
@@ -78,7 +78,7 @@
       $('input.block_user_role').val(role);
       $('div.model-block-list').html(userlist.html());
   });
-  $('form[action="block_user"]').submit(function() {
+  $('form[action="block_user"], form[action="unblock_user"]').submit(function() {
     var form = $(this);
     if($(this).is(':visible')) {
         $.ajax({


Mime
View raw message