allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [5/6] allura git commit: [#3593] further deprecate Tools link in admin menu
Date Wed, 13 Jul 2016 20:47:08 GMT
[#3593] further deprecate Tools link in admin menu


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

Branch: refs/heads/master
Commit: c7cbaa2aa1470c08f97f04d982f6a1fff1893ce8
Parents: fb632ad
Author: Dave Brondsema <dave@brondsema.net>
Authored: Wed Jul 6 18:41:22 2016 -0400
Committer: Dave Brondsema <dave@brondsema.net>
Committed: Wed Jul 13 16:38:21 2016 -0400

----------------------------------------------------------------------
 Allura/allura/ext/admin/admin_main.py | 5 ++++-
 Allura/allura/lib/plugin.py           | 3 ++-
 Allura/allura/model/artifact.py       | 2 --
 3 files changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/c7cbaa2a/Allura/allura/ext/admin/admin_main.py
----------------------------------------------------------------------
diff --git a/Allura/allura/ext/admin/admin_main.py b/Allura/allura/ext/admin/admin_main.py
index a9c5daf..3759098 100644
--- a/Allura/allura/ext/admin/admin_main.py
+++ b/Allura/allura/ext/admin/admin_main.py
@@ -148,7 +148,10 @@ class AdminApp(Application):
                     SitemapEntry('Screenshots', admin_url + 'screenshots'),
                     SitemapEntry('Categorization', admin_url + 'trove')
                 ]
-        links.append(SitemapEntry('Tools', admin_url + 'tools_moved'))
+        if plugin.ProjectRegistrationProvider.get().registration_date(c.project) < datetime(2016,
6, 1):
+            # only show transitional Tools page to older projects that may be used to it
+            # no point is showing it to new projects
+            links.append(SitemapEntry('Tools', admin_url + 'tools_moved'))
         if asbool(config.get('bulk_export_enabled', True)):
             links.append(SitemapEntry('Export', admin_url + 'export'))
         if c.project.is_root and has_access(c.project, 'admin')():

http://git-wip-us.apache.org/repos/asf/allura/blob/c7cbaa2a/Allura/allura/lib/plugin.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/plugin.py b/Allura/allura/lib/plugin.py
index 06242c4..f449887 100644
--- a/Allura/allura/lib/plugin.py
+++ b/Allura/allura/lib/plugin.py
@@ -1026,7 +1026,8 @@ class ProjectRegistrationProvider(object):
         '''
         Return the datetime the project was created.
         '''
-        return project._id.generation_time
+        # generation_time is offset-aware UTC, but everything else is offset-naive
+        return project._id.generation_time.replace(tzinfo=None)
 
     def details_links(self, project):
         '''Return list of pairs (url, label) with details

http://git-wip-us.apache.org/repos/asf/allura/blob/c7cbaa2a/Allura/allura/model/artifact.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/artifact.py b/Allura/allura/model/artifact.py
index 0d177ce..a98394e 100644
--- a/Allura/allura/model/artifact.py
+++ b/Allura/allura/model/artifact.py
@@ -441,8 +441,6 @@ class Artifact(MappedClass, SearchIndexable):
         count_in_app = lambda: cls.query.find(dict(app_config_id=app_config._id)).count()
         provider = plugin.ProjectRegistrationProvider.get()
         start = provider.registration_date(app_config.project)
-        # need the replace because the generation_time is offset-aware UTC and h.rate_limit
uses offset-naive UTC dates
-        start = start.replace(tzinfo=None)
 
         try:
             h.rate_limit(opt, count_in_app, start)


Mime
View raw message