Skip to content

Commit 7c059e3

Browse files
author
Richard Jones
committed
finished off handling of retired flag in filter() [SF#635260]
(bugfix in mailgw unit tests for x-roundup-loop too)
1 parent d0f33f9 commit 7c059e3

File tree

3 files changed

+30
-4
lines changed

3 files changed

+30
-4
lines changed

CHANGES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ are given with the most recent entry first.
1717
- reverse message listing in issue display (reversion of recent change)
1818
- bad entries for multilink editing in cgi don't traceback now (sf bug 640310)
1919
- detect and break email loops (sf bug 640854)
20+
- finished of handling of retired flag in filter() (sf bug 635260)
2021

2122

2223
2002-11-07 0.5.2

roundup/cgi/templating.py

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -971,7 +971,11 @@ def field(self, showid=0, size=None):
971971
else:
972972
s = ''
973973
l.append(_('<option %svalue="-1">- no selection -</option>')%s)
974-
# XXX if the current value is retired, then list it explicitly
974+
975+
# make sure we list the current value if it's retired
976+
if self._value and self._value not in options:
977+
options.insert(0, self._value)
978+
975979
for optionid in options:
976980
# get the option value, and if it's None use an empty string
977981
option = linkcl.get(optionid, k) or ''
@@ -1018,7 +1022,11 @@ def menu(self, size=None, height=None, showid=0, additional=[],
10181022
else:
10191023
sort_on = ('+', linkcl.labelprop())
10201024
options = linkcl.filter(None, conditions, sort_on, (None, None))
1021-
# XXX if the current value is retired, then list it explicitly
1025+
1026+
# make sure we list the current value if it's retired
1027+
if self._value and self._value not in options:
1028+
options.insert(0, self._value)
1029+
10221030
for optionid in options:
10231031
# get the option value, and if it's None use an empty string
10241032
option = linkcl.get(optionid, k) or ''
@@ -1139,7 +1147,12 @@ def menu(self, size=None, height=None, showid=0, additional=[],
11391147
height = height or min(len(options), 7)
11401148
l = ['<select multiple name="%s" size="%s">'%(self._name, height)]
11411149
k = linkcl.labelprop(1)
1142-
# XXX if any of the current values are retired, then list them
1150+
1151+
# make sure we list the current values if they're retired
1152+
for value in self._value:
1153+
if value not in options:
1154+
options.insert(0, value)
1155+
11431156
for optionid in options:
11441157
# get the option value, and if it's None use an empty string
11451158
option = linkcl.get(optionid, k) or ''

test/test_mailgw.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# but WITHOUT ANY WARRANTY; without even the implied warranty of
99
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
1010
#
11-
# $Id: test_mailgw.py,v 1.34 2002-12-10 00:11:16 richard Exp $
11+
# $Id: test_mailgw.py,v 1.35 2002-12-10 00:46:55 richard Exp $
1212

1313
import unittest, cStringIO, tempfile, os, shutil, errno, imp, sys, difflib
1414

@@ -211,6 +211,7 @@ def testNewIssueAuthMsg(self):
211211
MIME-Version: 1.0
212212
Message-Id: <dummy_test_message_id>
213213
X-Roundup-Name: Roundup issue tracker
214+
X-Roundup-Loop: hello
214215
Content-Transfer-Encoding: quoted-printable
215216
216217
@@ -267,6 +268,7 @@ def testSimpleFollowup(self):
267268
Message-Id: <followup_dummy_id>
268269
In-Reply-To: <dummy_test_message_id>
269270
X-Roundup-Name: Roundup issue tracker
271+
X-Roundup-Loop: hello
270272
Content-Transfer-Encoding: quoted-printable
271273
272274
@@ -315,6 +317,7 @@ def testFollowup(self):
315317
Message-Id: <followup_dummy_id>
316318
In-Reply-To: <dummy_test_message_id>
317319
X-Roundup-Name: Roundup issue tracker
320+
X-Roundup-Loop: hello
318321
Content-Transfer-Encoding: quoted-printable
319322
320323
@@ -361,6 +364,7 @@ def testFollowupTitleMatch(self):
361364
Message-Id: <followup_dummy_id>
362365
In-Reply-To: <dummy_test_message_id>
363366
X-Roundup-Name: Roundup issue tracker
367+
X-Roundup-Loop: hello
364368
Content-Transfer-Encoding: quoted-printable
365369
366370
@@ -408,6 +412,7 @@ def testFollowupNosyAuthor(self):
408412
Message-Id: <followup_dummy_id>
409413
In-Reply-To: <dummy_test_message_id>
410414
X-Roundup-Name: Roundup issue tracker
415+
X-Roundup-Loop: hello
411416
Content-Transfer-Encoding: quoted-printable
412417
413418
@@ -456,6 +461,7 @@ def testFollowupNosyRecipients(self):
456461
Message-Id: <followup_dummy_id>
457462
In-Reply-To: <dummy_test_message_id>
458463
X-Roundup-Name: Roundup issue tracker
464+
X-Roundup-Loop: hello
459465
Content-Transfer-Encoding: quoted-printable
460466
461467
@@ -504,6 +510,7 @@ def testFollowupNosyAuthorAndCopy(self):
504510
Message-Id: <followup_dummy_id>
505511
In-Reply-To: <dummy_test_message_id>
506512
X-Roundup-Name: Roundup issue tracker
513+
X-Roundup-Loop: hello
507514
Content-Transfer-Encoding: quoted-printable
508515
509516
@@ -551,6 +558,7 @@ def testFollowupNoNosyAuthor(self):
551558
Message-Id: <followup_dummy_id>
552559
In-Reply-To: <dummy_test_message_id>
553560
X-Roundup-Name: Roundup issue tracker
561+
X-Roundup-Loop: hello
554562
Content-Transfer-Encoding: quoted-printable
555563
556564
@@ -598,6 +606,7 @@ def testFollowupNoNosyRecipients(self):
598606
Message-Id: <followup_dummy_id>
599607
In-Reply-To: <dummy_test_message_id>
600608
X-Roundup-Name: Roundup issue tracker
609+
X-Roundup-Loop: hello
601610
Content-Transfer-Encoding: quoted-printable
602611
603612
@@ -706,6 +715,7 @@ def testEnc01(self):
706715
Message-Id: <followup_dummy_id>
707716
In-Reply-To: <dummy_test_message_id>
708717
X-Roundup-Name: Roundup issue tracker
718+
X-Roundup-Loop: hello
709719
Content-Transfer-Encoding: quoted-printable
710720
711721
@@ -760,6 +770,7 @@ def testMultipartEnc01(self):
760770
Message-Id: <followup_dummy_id>
761771
In-Reply-To: <dummy_test_message_id>
762772
X-Roundup-Name: Roundup issue tracker
773+
X-Roundup-Loop: hello
763774
Content-Transfer-Encoding: quoted-printable
764775
765776
@@ -804,6 +815,7 @@ def testFollowupStupidQuoting(self):
804815
Message-Id: <followup_dummy_id>
805816
In-Reply-To: <dummy_test_message_id>
806817
X-Roundup-Name: Roundup issue tracker
818+
X-Roundup-Loop: hello
807819
Content-Transfer-Encoding: quoted-printable
808820
809821

0 commit comments

Comments
 (0)