Skip to content

Commit 8fa82aa

Browse files
committed
issue2550763 Strip whitespace from Multilink values after + or -.
Diagnosis, patch developed by W. Trevor King. Test heavily modified by John Rouillard. The goal is to make: Subject: [issue23455] ... [ keyword =+ Foo,Foo Zot ; nosy =+ mary ] act like: Subject: [issue23455] ... [ keyword =+Foo,Foo Zot; nosy =+mary] Without the patch " Foo" is not recognized.
1 parent 6c2d1a8 commit 8fa82aa

File tree

3 files changed

+55
-2
lines changed

3 files changed

+55
-2
lines changed

CHANGES.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ Fixed:
6363
- Update documentation of some existing property attributes (like
6464
'do_journal' for Link/Multilink properties), this also adds missing
6565
documentation for issue1444214. (Ralf Schlatterbeck)
66+
- issue2550763 Strip whitespace from Multilink values after + or -.
67+
(W. Trevor King) Test heavily modified by John Rouillard. (applied
68+
by John Rouillard)
6669

6770
2016-01-11: 1.5.1
6871

roundup/hyperdb.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,10 +232,10 @@ def from_raw(self, value, db, klass, propname, itemid, **kw):
232232
remove = 0
233233
if item.startswith('-'):
234234
remove = 1
235-
item = item[1:]
235+
item = item[1:].strip()
236236
do_set = 0
237237
elif item.startswith('+'):
238-
item = item[1:]
238+
item = item[1:].strip()
239239
do_set = 0
240240

241241
# look up the value

test/test_mailgw.py

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3046,6 +3046,56 @@ def testSecurityMessagePermissionContent(self):
30463046
nosy: +mary
30473047
status: unread -> chatting
30483048
3049+
_______________________________________________________________________
3050+
Roundup issue tracker <[email protected]>
3051+
<http://tracker.example/cgi-bin/roundup.cgi/bugs/issue1>
3052+
_______________________________________________________________________
3053+
''')
3054+
3055+
def testSpacesAroundMultilinkPropertyValue(self):
3056+
self.db.keyword.create(name='Foo')
3057+
self.db.keyword.create(name='Bar')
3058+
self.db.keyword.create(name='Baz This')
3059+
nodeid1 = self.doNewIssue()
3060+
nodeid2 = self._handle_mail('''Content-Type: text/plain;
3061+
charset="iso-8859-1"
3062+
From: "Bork, Chef" <[email protected]>
3063+
3064+
Message-Id: <followup_dummy_id>
3065+
In-Reply-To: <dummy_test_message_id>
3066+
Subject: [issue1] set keyword [ keyword =+ Foo,Baz This ; nosy =+ mary ]
3067+
3068+
Set the Foo and Baz This keywords along with mary for nosy.
3069+
''')
3070+
assert os.path.exists(SENDMAILDEBUG)
3071+
self.compareMessages(self._get_mail(),
3072+
3073+
3074+
Content-Type: text/plain; charset="utf-8"
3075+
Subject: [issue1] set keyword
3076+
3077+
From: "Bork, Chef" <[email protected]>
3078+
Reply-To: Roundup issue tracker
3079+
3080+
MIME-Version: 1.0
3081+
Message-Id: <followup_dummy_id>
3082+
In-Reply-To: <dummy_test_message_id>
3083+
X-Roundup-Name: Roundup issue tracker
3084+
X-Roundup-Loop: hello
3085+
X-Roundup-Issue-Status: chatting
3086+
X-Roundup-Issue-keyword: Foo, Baz This
3087+
Content-Transfer-Encoding: quoted-printable
3088+
3089+
Bork, Chef <[email protected]> added the comment:
3090+
3091+
Set the Foo and Baz This keywords along with mary for nosy.
3092+
3093+
----------
3094+
keyword: +Baz This, Foo
3095+
nosy: +mary
3096+
status: unread -> chatting
3097+
title: Testing... -> set keyword
3098+
30493099
_______________________________________________________________________
30503100
Roundup issue tracker <[email protected]>
30513101
<http://tracker.example/cgi-bin/roundup.cgi/bugs/issue1>

0 commit comments

Comments
 (0)