allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hei...@apache.org
Subject allura git commit: When deleting a user project, actually do it - not just disable the user
Date Wed, 06 Apr 2016 18:56:06 GMT
Repository: allura
Updated Branches:
  refs/heads/master c55705c60 -> 43bfe22a1


When deleting a user project, actually do it - not just disable the user


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

Branch: refs/heads/master
Commit: 43bfe22a1b30990990c9de63ae57da8a1e574fbe
Parents: c55705c
Author: Dave Brondsema <dave@brondsema.net>
Authored: Wed Mar 30 17:45:44 2016 +0000
Committer: Heith Seewald <heiths@gmail.com>
Committed: Wed Apr 6 14:49:22 2016 -0400

----------------------------------------------------------------------
 Allura/allura/scripts/delete_projects.py            | 8 ++++----
 Allura/allura/tests/scripts/test_delete_projects.py | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/43bfe22a/Allura/allura/scripts/delete_projects.py
----------------------------------------------------------------------
diff --git a/Allura/allura/scripts/delete_projects.py b/Allura/allura/scripts/delete_projects.py
index 1b7aa95..9b28f64 100644
--- a/Allura/allura/scripts/delete_projects.py
+++ b/Allura/allura/scripts/delete_projects.py
@@ -39,7 +39,7 @@ class DeleteProjects(ScriptTask):
             proj = cls.get_project(proj)
             if proj:
                 if proj.is_user_project:
-                    # disabling a user makes the project pages 404, so do that instead of
deleting the project
+                    # disable user as well
                     user = proj.user_project_of
                     if user:
                         auth_provider.disable_user(user, audit=False)
@@ -49,9 +49,9 @@ class DeleteProjects(ScriptTask):
                         session(log_entry).flush(log_entry)
                     else:
                         log.info('Could not find associated user for user-project %s', proj.shortname)
-                else:
-                    log.info('Purging %s%s. Reason: %s', proj.neighborhood.url_prefix, proj.shortname,
options.reason)
-                    provider.purge_project(proj, disable_users=options.disable_users, reason=options.reason)
+
+                log.info('Purging %s Reason: %s', proj.url(), options.reason)
+                provider.purge_project(proj, disable_users=options.disable_users, reason=options.reason)
 
     @classmethod
     def get_project(cls, proj):

http://git-wip-us.apache.org/repos/asf/allura/blob/43bfe22a/Allura/allura/tests/scripts/test_delete_projects.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/scripts/test_delete_projects.py b/Allura/allura/tests/scripts/test_delete_projects.py
index 5cbd82f..5f222e0 100644
--- a/Allura/allura/tests/scripts/test_delete_projects.py
+++ b/Allura/allura/tests/scripts/test_delete_projects.py
@@ -124,7 +124,7 @@ class TestDeleteProjects(TestController):
         session(p).expunge(p)
         p = M.Project.query.get(shortname=p.shortname)
         assert p is None, 'Project is not deleted'
-        log.info.assert_called_once_with('Purging %s%s. Reason: %s', '/p/', 'test-delete',
'The Reason')
+        log.info.assert_called_once_with('Purging %s Reason: %s', '/p/test-delete/', 'The
Reason')
         post_event.assert_called_once_with('project_deleted', project_id=pid, reason='The
Reason')
 
     def _disable_users(self, disable):


Mime
View raw message