Changeset - 4707d09d49a6
[Not reviewed]
default
0 2 0
Mads Kiilerich - 7 years ago 2018-06-04 14:26:37
mads@kiilerich.com
repos: make edit_permissions_revoke controller return an actual (empty) body on success

The code 204 was slightly confusing even though technically OK.
2 files changed with 2 insertions and 1 deletions:
0 comments (0 inline, 0 general)
kallithea/controllers/admin/repos.py
Show inline comments
 
@@ -352,12 +352,13 @@ class ReposController(BaseRepoController
 
            Session().commit()
 
        except Exception:
 
            log.error(traceback.format_exc())
 
            h.flash(_('An error occurred during revoking of permission'),
 
                    category='error')
 
            raise HTTPInternalServerError()
 
        return []
 

	
 
    @HasRepoPermissionLevelDecorator('admin')
 
    def edit_fields(self, repo_name):
 
        c.repo_info = self._load_repo()
 
        c.repo_fields = RepositoryField.query() \
 
            .filter(RepositoryField.repository == c.repo_info).all()
kallithea/tests/functional/test_admin_permissions.py
Show inline comments
 
@@ -122,8 +122,8 @@ class TestAdminPermissionsController(Tes
 
        response = self.app.post(
 
            url('edit_repo_perms_revoke', repo_name=HG_REPO),
 
            params=dict(
 
                obj_type='user',
 
                user_id=user.user_id,
 
                _authentication_token=self.authentication_token()),
 
            status=204) # success has no content
 
            status=200)
 
        assert not response.body
0 comments (0 inline, 0 general)