allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [1/2] git commit: [#7208] add registration_date method to ProjectRegistrationProvider
Date Thu, 03 Apr 2014 21:01:53 GMT
Repository: allura
Updated Branches:
  refs/heads/master 461a4b542 -> 323c00dab


[#7208] add registration_date method to ProjectRegistrationProvider


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

Branch: refs/heads/master
Commit: 323c00dabd195dfbd2e3f6bf090c57b5e9fd4209
Parents: d37bf5f
Author: Dave Brondsema <dbrondsema@slashdotmedia.com>
Authored: Thu Apr 3 20:18:59 2014 +0000
Committer: Dave Brondsema <dbrondsema@slashdotmedia.com>
Committed: Thu Apr 3 21:01:40 2014 +0000

----------------------------------------------------------------------
 Allura/allura/lib/plugin.py    | 6 ++++++
 Allura/allura/model/project.py | 3 ++-
 2 files changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/323c00da/Allura/allura/lib/plugin.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/plugin.py b/Allura/allura/lib/plugin.py
index 7aea613..2a09d73 100644
--- a/Allura/allura/lib/plugin.py
+++ b/Allura/allura/lib/plugin.py
@@ -683,6 +683,12 @@ class ProjectRegistrationProvider(object):
            It should be overridden for your specific envirnoment'''
         return None
 
+    def registration_date(self, project):
+        '''
+        Return the datetime the project was created.
+        '''
+        return project._id.generation_time
+
 
 class ThemeProvider(object):
 

http://git-wip-us.apache.org/repos/asf/allura/blob/323c00da/Allura/allura/model/project.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/project.py b/Allura/allura/model/project.py
index 16733cc..ed581d0 100644
--- a/Allura/allura/model/project.py
+++ b/Allura/allura/model/project.py
@@ -1046,7 +1046,8 @@ class Project(MappedClass, ActivityNode, ActivityObject):
         ET.SubElement(project, 'sf:private').text = '1' if self.private else '0'  # strange,
but sf.net does this
         ET.SubElement(project, 'shortdesc', {'xml:lang': 'en'}).text = self.summary
         ET.SubElement(project, 'description', {'xml:lang': 'en'}).text = self.short_description
-        ET.SubElement(project, 'created').text = self._id.generation_time.strftime('%Y-%m-%d')
+        registration_date = plugin.ProjectRegistrationProvider.get().registration_date(self)
+        ET.SubElement(project, 'created').text = registration_date.strftime('%Y-%m-%d')
         if self.external_homepage:
             ET.SubElement(project, 'homepage', {'rdf:resource': self.external_homepage})
 


Mime
View raw message