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 2017/09/27 22:08:00 UTC

[1/2] allura git commit: If small icon requested, allow resizing down from old icons even if we don't have newer fullsize original

Repository: allura
Updated Branches:
  refs/heads/db/8048 [created] edc7a2b67


If small icon requested, allow resizing down from old icons even if we don't have newer fullsize original


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

Branch: refs/heads/db/8048
Commit: edc7a2b67d2dcfa60bc41e05aa8af8c1922d59a5
Parents: 039e153
Author: Dave Brondsema <da...@brondsema.net>
Authored: Wed Sep 27 17:45:48 2017 -0400
Committer: Dave Brondsema <da...@brondsema.net>
Committed: Wed Sep 27 18:07:25 2017 -0400

----------------------------------------------------------------------
 Allura/allura/model/project.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/edc7a2b6/Allura/allura/model/project.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/project.py b/Allura/allura/model/project.py
index 1223659..92f4d9b 100644
--- a/Allura/allura/model/project.py
+++ b/Allura/allura/model/project.py
@@ -387,7 +387,10 @@ class Project(SearchIndexable, MappedClass, ActivityNode, ActivityObject):
         if not sized and w != DEFAULT_ICON_WIDTH:
             orig = self.icon_original
             if not orig:
-                return None
+                if w > DEFAULT_ICON_WIDTH:
+                    return None
+                else:
+                    orig = self.icon
             sized = orig.save_thumbnail(filename='',
                                         image=PIL.Image.open(orig.rfile()),
                                         content_type=orig.content_type,


[2/2] allura git commit: [#8048] better email subject and message-id handling for merge requests

Posted by br...@apache.org.
[#8048] better email subject and message-id handling for merge requests

I'm not entirely clear why Thread.new needs a ref_id instead of a
artifact_reference, but that matches the usage in other tools, and
makes the email notifications use the right subject (no "discussion"
in subject text).


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

Branch: refs/heads/db/8048
Commit: 039e153bee834079264a261283f0dfce5de5b490
Parents: 78b89b4
Author: Dave Brondsema <da...@brondsema.net>
Authored: Wed Sep 27 17:44:54 2017 -0400
Committer: Dave Brondsema <da...@brondsema.net>
Committed: Wed Sep 27 18:07:25 2017 -0400

----------------------------------------------------------------------
 Allura/allura/controllers/repository.py | 9 +++++----
 Allura/allura/model/repository.py       | 8 ++++++--
 2 files changed, 11 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/039e153b/Allura/allura/controllers/repository.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/repository.py b/Allura/allura/controllers/repository.py
index 8a02905..97caa94 100644
--- a/Allura/allura/controllers/repository.py
+++ b/Allura/allura/controllers/repository.py
@@ -199,12 +199,13 @@ class RepoRootController(BaseController, FeedController):
                 description=kw['description'])
             M.Notification.post(
                 mr, 'merge_request',
-                subject='Merge request: ' + mr.summary)
+                subject=mr.email_subject,
+                message_id=mr.message_id(),
+            )
             t = M.Thread.new(
                 discussion_id=c.app.config.discussion_id,
-                artifact_reference=mr.index_id(),
-                subject='Discussion for Merge Request #:%s: %s' % (
-                    mr.request_number, mr.summary))
+                ref_id=mr.index_id(),
+            )
             session(t).flush()
             redirect(mr.url())
 

http://git-wip-us.apache.org/repos/asf/allura/blob/039e153b/Allura/allura/model/repository.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/repository.py b/Allura/allura/model/repository.py
index 4c508b7..c2abdd5 100644
--- a/Allura/allura/model/repository.py
+++ b/Allura/allura/model/repository.py
@@ -862,10 +862,14 @@ class MergeRequest(VersionedArtifact, ActivityObject):
         result.update(
             name_s='Merge Request #%d' % self.request_number,
             type_s=self.type_s,
-            title='Merge Request #%d of %s:%s' % (
-                self.request_number, self.project.name, self.app.repo.name))
+            title=self.email_subject,
+        )
         return result
 
+    @property
+    def email_subject(self):
+        return u'Merge request: ' + self.summary
+
     def merge_allowed(self, user):
         """
         Returns true if a merge is allowed by system and tool configuration.