Skip to content

Commit d383fac

Browse files
committed
Merged branch/iola/migration-fixes@4319, containing these changesets from olau@iola.dk:
- [4319]: Only query for regular IETF meetings when calculating cut off dates (reported by Ryan Cross). - [4311]: Fix bug in liaison form that prevents Secretariat users from posting statements on behalf of SDO liaison managers in some cases. - [4310]: Fix problem with direct replyto path in liaison form not using role emails (reported by Stephanie McCammon). - [4307]: Fix missing return in liaison proxy, fixes problem with from email on https://datatracker.ietf.org/liaison/1154/ as reported by Stephanie McCammon. - [4260]: Move note about IANA scraping messages, apparently I managed to put it in the wrong place (they're of course scraping draft approvals, not the ballot announcements). - [4253]: Move last call announcement text to last call event rather than stuffing it inside the state change event. - [4252]: Declare coding system to work around annoying problem when the date produced by SVN is localized. - Legacy-Id: 4331 Note: SVN reference [4252] has been migrated to Git commit 5858454 Note: SVN reference [4253] has been migrated to Git commit 25cb532 Note: SVN reference [4260] has been migrated to Git commit 7b2963a Note: SVN reference [4307] has been migrated to Git commit b418e5d Note: SVN reference [4310] has been migrated to Git commit 9b4415f Note: SVN reference [4311] has been migrated to Git commit bbeaa2d Note: SVN reference [4319] has been migrated to Git commit 7db44f8
2 parents 928e190 + 7db44f8 commit d383fac

7 files changed

Lines changed: 30 additions & 18 deletions

File tree

ietf/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# -*- coding: utf-8 -*-
12
# Copyright The IETF Trust 2007, All Rights Reserved
23

34
__version__ = "4.02-dev"

ietf/idrfc/mails.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -586,10 +586,6 @@ def formatted(val):
586586
e = doc.latest_event(WriteupDocEvent, type="changed_ballot_writeup_text")
587587
ballot_writeup = e.text if e else ""
588588

589-
# NOTE: according to Michelle Cotton <michelle.cotton@icann.org>
590-
# (as per 2011-10-24) IANA is scraping these messages for
591-
# information so would like to know beforehand if the format
592-
# changes (perhaps RFC 6359 will change that)
593589
return render_to_string("idrfc/issue_ballot_mailREDESIGN.txt",
594590
dict(doc=doc,
595591
doc_url=settings.IDTRACKER_BASE_URL + doc.get_absolute_url(),

ietf/idrfc/utils.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,6 @@ def log_state_changedREDESIGN(request, doc, by, prev_iesg_state, prev_iesg_tag):
7979
e = DocEvent(doc=doc, by=by)
8080
e.type = "changed_document"
8181
e.desc = u"State changed to <b>%s</b> from %s" % (state_name, prev_state_name)
82-
83-
if state.slug == "lc":
84-
writeup = doc.latest_event(WriteupDocEvent, type="changed_last_call_text")
85-
if writeup and writeup.text:
86-
e.desc += "<br><br><b>The following Last Call Announcement was sent out:</b><br><br>"
87-
e.desc += writeup.text.replace("\n", "<br><br>")
88-
8982
e.save()
9083
return e
9184

ietf/idrfc/views_ballot.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1228,6 +1228,10 @@ def approve_ballotREDESIGN(request, name):
12281228
else:
12291229
action = "to_announcement_list"
12301230

1231+
# NOTE: according to Michelle Cotton <michelle.cotton@icann.org>
1232+
# (as per 2011-10-24) IANA is scraping these messages for
1233+
# information so would like to know beforehand if the format
1234+
# changes (perhaps RFC 6359 will change that)
12311235
announcement = approval_text + "\n\n" + ballot_writeup
12321236

12331237
if request.method == 'POST':
@@ -1393,7 +1397,9 @@ def make_last_callREDESIGN(request, name):
13931397

13941398
e = LastCallDocEvent(doc=doc, by=login)
13951399
e.type = "sent_last_call"
1396-
e.desc = "Last call sent"
1400+
e.desc = "The following Last Call announcement was sent out:<br><br>"
1401+
e.desc += announcement
1402+
13971403
if form.cleaned_data['last_call_sent_date'] != e.time.date():
13981404
e.time = datetime.datetime.combine(form.cleaned_data['last_call_sent_date'], e.time.time())
13991405
e.expires = form.cleaned_data['last_call_expiration_date']

ietf/liaisons/formsREDESIGN.py

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from ietf.liaisons.models import LiaisonStatement, LiaisonStatementPurposeName
1717
from ietf.liaisons.proxy import LiaisonDetailProxy
1818
from ietf.group.models import Group
19-
from ietf.person.models import Person
19+
from ietf.person.models import Person, Email
2020
from ietf.doc.models import Document
2121

2222

@@ -313,6 +313,14 @@ def set_from_field(self):
313313
self.fields['from_field'].choices = [('sdo_%s' % i.pk, i.name) for i in sdos.order_by("name")]
314314
self.fields['from_field'].widget.submitter = unicode(self.person)
315315

316+
def set_replyto_field(self):
317+
e = Email.objects.filter(person=self.person, role__group__state="active", role__name__in=["liaiman", "auth"])
318+
if e:
319+
addr = e[0].address
320+
else:
321+
addr = self.person.email_address()
322+
self.fields['replyto'].initial = addr
323+
316324
def set_organization_field(self):
317325
self.fields['organization'].choices = self.hm.get_all_incoming_entities()
318326

@@ -360,6 +368,14 @@ def set_from_field(self):
360368
self.fields['from_field'].widget.submitter = unicode(self.person)
361369
self.fieldsets[0] = ('From', ('from_field', 'replyto', 'approved'))
362370

371+
def set_replyto_field(self):
372+
e = Email.objects.filter(person=self.person, role__group__state="active", role__name__in=["ad", "chair"])
373+
if e:
374+
addr = e[0].address
375+
else:
376+
addr = self.person.email_address()
377+
self.fields['replyto'].initial = addr
378+
363379
def set_organization_field(self):
364380
# If the user is a liaison manager and is nothing more, reduce the To field to his SDOs
365381
if not self.hm.get_entities_for_person(self.person) and is_sdo_liaison_manager(self.person):
@@ -409,7 +425,7 @@ def clean_organization(self):
409425
# If the from entity is one in wich the user has full privileges the to entity could be anyone
410426
if from_code in [i[0] for i in all_entities]:
411427
return to_code
412-
sdo_codes = ['sdo_%s' % i.pk for i in liaison_manager_sdos(self.person)]
428+
sdo_codes = ['sdo_%s' % i.pk for i in liaison_manager_sdos(person)]
413429
if to_code in sdo_codes:
414430
return to_code
415431
entity = self.get_to_entity()

ietf/liaisons/proxy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ def from_body(self):
136136
def from_sdo(self):
137137
return self.from_group if self.from_group and self.from_group.type_id == "sdo" else None
138138
def from_email(self):
139-
self.from_contact.address
139+
return self.from_contact.address
140140
def get_absolute_url(self):
141141
return '/liaison/%d/' % self.detail_id
142142
class Meta:

ietf/meeting/models.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,19 +53,19 @@ def get_meeting_date (self,offset):
5353

5454
@classmethod
5555
def get_first_cut_off(cls):
56-
date = cls.objects.all().order_by('-date')[0].date
56+
date = cls.objects.all().filter(type="ietf").order_by('-date')[0].date
5757
offset = datetime.timedelta(days=settings.FIRST_CUTOFF_DAYS)
5858
return date - offset
5959

6060
@classmethod
6161
def get_second_cut_off(cls):
62-
date = cls.objects.all().order_by('-date')[0].date
62+
date = cls.objects.all().filter(type="ietf").order_by('-date')[0].date
6363
offset = datetime.timedelta(days=settings.SECOND_CUTOFF_DAYS)
6464
return date - offset
6565

6666
@classmethod
6767
def get_ietf_monday(cls):
68-
date = cls.objects.all().order_by('-date')[0].date
68+
date = cls.objects.all().filter(type="ietf").order_by('-date')[0].date
6969
return date + datetime.timedelta(days=-date.weekday(), weeks=1)
7070

7171
# the various dates are currently computed

0 commit comments

Comments
 (0)