You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by br...@apache.org on 2018/09/20 20:21:46 UTC

[1/2] allura git commit: [#6560] Add a comment line

Repository: allura
Updated Branches:
  refs/heads/master 5ad16d621 -> 1c28d5dc2


[#6560] Add a comment line


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

Branch: refs/heads/master
Commit: 1c28d5dc2965841b192ac6202c8883d989d66fa5
Parents: 3afec2c
Author: Shalitha <sh...@gmail.com>
Authored: Thu Sep 20 20:03:39 2018 +0530
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Thu Sep 20 20:20:51 2018 +0000

----------------------------------------------------------------------
 Allura/allura/ext/admin/admin_main.py | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/1c28d5dc/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 aaa480d..1b61002 100644
--- a/Allura/allura/ext/admin/admin_main.py
+++ b/Allura/allura/ext/admin/admin_main.py
@@ -521,6 +521,7 @@ class ProjectAdminController(BaseController):
             for screen in screenshots:
                 if screen.filename == screenshot.filename:
                     screenshot.filename = re.sub('(.*)\.(.*)', r'\1-' + str(randint(1000,9999)) + r'.\2', screenshot.filename)
+                    # if filename already exists append a random number
                     break
             M.AuditLog.log('add screenshot')
             sort = 1 + max([ss.sort or 0 for ss in screenshots] or [0])


[2/2] allura git commit: [#6560] Append random number for duplicate image filename

Posted by br...@apache.org.
[#6560] Append random number for duplicate image filename


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

Branch: refs/heads/master
Commit: 3afec2c085c525bf7c044aaf37ee050ec07eee6a
Parents: 5ad16d6
Author: Shalitha <sh...@gmail.com>
Authored: Thu Sep 20 20:00:15 2018 +0530
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Thu Sep 20 20:20:51 2018 +0000

----------------------------------------------------------------------
 Allura/allura/ext/admin/admin_main.py | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/3afec2c0/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 247a55b..aaa480d 100644
--- a/Allura/allura/ext/admin/admin_main.py
+++ b/Allura/allura/ext/admin/admin_main.py
@@ -17,6 +17,7 @@
 
 import logging
 import re
+from random import randint
 from collections import OrderedDict
 from datetime import datetime
 from urlparse import urlparse
@@ -517,6 +518,10 @@ class ProjectAdminController(BaseController):
             flash('You may not have more than 6 screenshots per project.',
                   'error')
         elif screenshot is not None and screenshot != '':
+            for screen in screenshots:
+                if screen.filename == screenshot.filename:
+                    screenshot.filename = re.sub('(.*)\.(.*)', r'\1-' + str(randint(1000,9999)) + r'.\2', screenshot.filename)
+                    break
             M.AuditLog.log('add screenshot')
             sort = 1 + max([ss.sort or 0 for ss in screenshots] or [0])
             M.ProjectFile.save_image(