Only trim ballot discusses/comments on the right side, not the left,

since some ADs are using the left-side for formatting, fixes #782.
 - Legacy-Id: 4022
This commit is contained in:
Ole Laursen 2012-03-02 13:38:20 +00:00
parent d8c6b6bd8e
commit 7747e3a836
2 changed files with 6 additions and 6 deletions

View file

@ -434,15 +434,15 @@ class EditPositionTestCase(django.test.TestCase):
events_before = draft.docevent_set.count()
r = self.client.post(url, dict(position="discuss",
discuss="This is a discussion test.",
comment="This is a test."))
discuss=" This is a discussion test. \n ",
comment=" This is a test. \n "))
self.assertEquals(r.status_code, 302)
pos = draft.latest_event(BallotPositionDocEvent, ad=ad)
self.assertEquals(pos.pos.slug, "discuss")
self.assertTrue("This is a discussion test." in pos.discuss)
self.assertTrue(" This is a discussion test." in pos.discuss)
self.assertTrue(pos.discuss_time != None)
self.assertTrue("This is a test." in pos.comment)
self.assertTrue(" This is a test." in pos.comment)
self.assertTrue(pos.comment_time != None)
self.assertTrue("New position" in pos.desc)
self.assertEquals(draft.docevent_set.count(), events_before + 3)

View file

@ -266,9 +266,9 @@ def edit_positionREDESIGN(request, name):
pos.type = "changed_ballot_position"
pos.ad = ad
pos.pos = clean["position"]
pos.comment = clean["comment"].strip()
pos.comment = clean["comment"].rstrip()
pos.comment_time = old_pos.comment_time if old_pos else None
pos.discuss = clean["discuss"].strip()
pos.discuss = clean["discuss"].rstrip()
pos.discuss_time = old_pos.discuss_time if old_pos else None
changes = []