Skip to content

Commit af768fb

Browse files
committed
Fix a bunch of merge bugs
- Legacy-Id: 3191
1 parent 91b3212 commit af768fb

5 files changed

Lines changed: 39 additions & 16 deletions

File tree

ietf/announcements/send_scheduled.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,13 @@ def send_scheduled_announcementREDESIGN(send_queue):
4949
# announcement.content_type can contain a case-sensitive parts separator,
5050
# so we need to keep it as is, not lowercased, but we want a lowercased
5151
# version for the coming comparisons.
52-
content_type_lowercase = announcement.content_type.lower()
52+
content_type_lowercase = message.content_type.lower()
5353
if not content_type_lowercase or 'text/plain' in content_type_lowercase:
5454
send_mail_text(None, message.to, message.frm, message.subject,
5555
body, cc=message.cc, bcc=message.bcc)
5656
elif 'multipart' in content_type_lowercase:
5757
# make body a real message so we can parse it
58-
body = ("MIME-Version: 1.0\r\nContent-Type: %s\r\n" % announcement.content_type) + body
58+
body = ("MIME-Version: 1.0\r\nContent-Type: %s\r\n" % message.content_type) + body
5959

6060
msg = email.message_from_string(body.encode("utf-8"))
6161
send_mail_mime(None, message.to, message.frm, message.subject,

ietf/idrfc/mails.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
from ietf.utils.mail import send_mail, send_mail_text
1212
from ietf.idtracker.models import *
1313
from ietf.ipr.search import iprs_from_docs
14-
from doc.models import WriteupDocEvent, BallotPositionDocEvent, LastCallDocEvent
15-
from person.models import Person
14+
from redesign.doc.models import WriteupDocEvent, BallotPositionDocEvent, LastCallDocEvent, DocAlias
15+
from redesign.person.models import Person
1616

1717
def email_state_changed(request, doc, text):
1818
to = [x.strip() for x in doc.idinternal.state_change_notice_to.replace(';', ',').split(',')]
@@ -157,9 +157,8 @@ def generate_last_call_announcementREDESIGN(request, doc):
157157
cc.append(doc.group.list_email)
158158

159159
doc.filled_title = textwrap.fill(doc.title, width=70, subsequent_indent=" " * 3)
160-
url = settings.IDTRACKER_BASE_URL + doc.get_absolute_url()
161160

162-
iprs, docs = iprs_from_docs([ doc ])
161+
iprs, _ = iprs_from_docs([ DocAlias.objects.get(name=doc.canonical_name()) ])
163162
if iprs:
164163
ipr_links = [ urlreverse("ietf.ipr.views.show", kwargs=dict(ipr_id=i.ipr_id)) for i in iprs]
165164
ipr_links = [ settings.IDTRACKER_BASE_URL+url if not url.startswith("http") else url for url in ipr_links ]
@@ -168,18 +167,18 @@ def generate_last_call_announcementREDESIGN(request, doc):
168167

169168
mail = render_to_string("idrfc/last_call_announcement.txt",
170169
dict(doc=doc,
171-
doc_url=settings.IDTRACKER_BASE_URL + doc.get_absolute_url(),
170+
doc_url=settings.IDTRACKER_BASE_URL + doc.get_absolute_url() + "ballot/",
172171
expiration_date=expiration_date.strftime("%Y-%m-%d"), #.strftime("%B %-d, %Y"),
173172
cc=", ".join("<%s>" % e for e in cc),
174173
group=group,
175-
docs=docs,
176-
urls=[url],
174+
docs=[ doc ],
175+
urls=[ settings.IDTRACKER_BASE_URL + doc.get_absolute_url() ],
177176
status=status,
178177
impl_report="Draft" in status or "Full" in status,
179178
ipr_links=ipr_links,
180179
)
181180
)
182-
181+
183182
e = WriteupDocEvent()
184183
e.type = "changed_last_call_text"
185184
e.by = request.user.get_profile()

ietf/idrfc/testsREDESIGN.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,11 +463,12 @@ def test_edit_position_as_secretary(self):
463463

464464
# vote on behalf of AD
465465
events_before = draft.docevent_set.count()
466-
r = self.client.post(url, dict(position="discuss"))
466+
r = self.client.post(url, dict(position="discuss", discuss="Test discuss text"))
467467
self.assertEquals(r.status_code, 302)
468468

469469
pos = draft.latest_event(BallotPositionDocEvent, ad=ad)
470470
self.assertEquals(pos.pos.slug, "discuss")
471+
self.assertEquals(pos.discuss, "Test discuss text")
471472
self.assertTrue("New position" in pos.desc)
472473
self.assertTrue("by Sec" in pos.desc)
473474

ietf/idrfc/views_ballot.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -471,16 +471,15 @@ def send_ballot_commentREDESIGN(request, name):
471471
c = pos.comment
472472
subj.append("COMMENT")
473473

474-
ad_name = ad.get_name()
475-
ad_name_genitive = ad_name + "'" if ad_name.endswith('s') else ad_name + "'s"
476-
subject = "%s %s on %s" % (ad_name_genitive, pos.pos.name if pos.pos else "No Position", "%s-%02d" % (doc.name, doc.rev))
474+
ad_name_genitive = ad.name + "'" if ad.name.endswith('s') else ad.name + "'s"
475+
subject = "%s %s on %s" % (ad_name_genitive, pos.pos.name if pos.pos else "No Position", doc.name + "-" + doc.rev)
477476
if subj:
478477
subject += ": (with %s)" % " and ".join(subj)
479478

480479
doc.filename = doc.name # compatibility attributes
481480
doc.revision_display = doc.rev
482481
body = render_to_string("idrfc/ballot_comment_mail.txt",
483-
dict(discuss=d, comment=c, ad=ad.get_name(), doc=doc, pos=pos.pos))
482+
dict(discuss=d, comment=c, ad=ad.name, doc=doc, pos=pos.pos))
484483
frm = ad.formatted_email()
485484
to = "The IESG <iesg@ietf.org>"
486485

ietf/utils/test_data.py

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from django.contrib.auth.models import User
22

33
from ietf.iesg.models import TelechatDates, WGAction
4+
from ietf.ipr.models import IprDetail, IprDocAlias
45
from redesign.doc.models import *
56
from redesign.name.models import *
67
from redesign.group.models import *
@@ -122,7 +123,7 @@ def make_test_data():
122123
note="",
123124
)
124125

125-
DocAlias.objects.create(
126+
doc_alias = DocAlias.objects.create(
126127
document=draft,
127128
name=draft.name,
128129
)
@@ -140,6 +141,29 @@ def make_test_data():
140141
doc=draft,
141142
desc="Added draft",
142143
)
144+
145+
# IPR
146+
ipr = IprDetail.objects.create(
147+
title="Statement regarding rights",
148+
legal_name="Native Martians United",
149+
is_pending=0,
150+
applies_to_all=1,
151+
licensing_option=1,
152+
lic_opt_a_sub=2,
153+
lic_opt_b_sub=2,
154+
lic_opt_c_sub=2,
155+
comments="",
156+
lic_checkbox=True,
157+
other_notes="",
158+
status=1,
159+
submitted_date=datetime.date.today(),
160+
)
161+
162+
IprDocAlias.objects.create(
163+
ipr=ipr,
164+
doc_alias=doc_alias,
165+
rev="00",
166+
)
143167

144168
# telechat dates
145169
t = datetime.date.today()

0 commit comments

Comments
 (0)