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 5858454c74

Note: SVN reference [4253] has been migrated to Git commit 25cb532348

Note: SVN reference [4260] has been migrated to Git commit 7b2963aaf0

Note: SVN reference [4307] has been migrated to Git commit b418e5d141

Note: SVN reference [4310] has been migrated to Git commit 9b4415fe51

Note: SVN reference [4311] has been migrated to Git commit bbeaa2d022

Note: SVN reference [4319] has been migrated to Git commit 7db44f8e50
This commit is contained in:
Henrik Levkowetz 2012-04-26 19:34:57 +00:00
commit d383fac853
7 changed files with 30 additions and 18 deletions

View file

@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
# Copyright The IETF Trust 2007, All Rights Reserved
__version__ = "4.02-dev"

View file

@ -586,10 +586,6 @@ def generate_issue_ballot_mailREDESIGN(request, doc):
e = doc.latest_event(WriteupDocEvent, type="changed_ballot_writeup_text")
ballot_writeup = e.text if e else ""
# NOTE: according to Michelle Cotton <michelle.cotton@icann.org>
# (as per 2011-10-24) IANA is scraping these messages for
# information so would like to know beforehand if the format
# changes (perhaps RFC 6359 will change that)
return render_to_string("idrfc/issue_ballot_mailREDESIGN.txt",
dict(doc=doc,
doc_url=settings.IDTRACKER_BASE_URL + doc.get_absolute_url(),

View file

@ -79,13 +79,6 @@ def log_state_changedREDESIGN(request, doc, by, prev_iesg_state, prev_iesg_tag):
e = DocEvent(doc=doc, by=by)
e.type = "changed_document"
e.desc = u"State changed to <b>%s</b> from %s" % (state_name, prev_state_name)
if state.slug == "lc":
writeup = doc.latest_event(WriteupDocEvent, type="changed_last_call_text")
if writeup and writeup.text:
e.desc += "<br><br><b>The following Last Call Announcement was sent out:</b><br><br>"
e.desc += writeup.text.replace("\n", "<br><br>")
e.save()
return e

View file

@ -1228,6 +1228,10 @@ def approve_ballotREDESIGN(request, name):
else:
action = "to_announcement_list"
# NOTE: according to Michelle Cotton <michelle.cotton@icann.org>
# (as per 2011-10-24) IANA is scraping these messages for
# information so would like to know beforehand if the format
# changes (perhaps RFC 6359 will change that)
announcement = approval_text + "\n\n" + ballot_writeup
if request.method == 'POST':
@ -1393,7 +1397,9 @@ def make_last_callREDESIGN(request, name):
e = LastCallDocEvent(doc=doc, by=login)
e.type = "sent_last_call"
e.desc = "Last call sent"
e.desc = "The following Last Call announcement was sent out:<br><br>"
e.desc += announcement
if form.cleaned_data['last_call_sent_date'] != e.time.date():
e.time = datetime.datetime.combine(form.cleaned_data['last_call_sent_date'], e.time.time())
e.expires = form.cleaned_data['last_call_expiration_date']

View file

@ -16,7 +16,7 @@ from ietf.liaisons.widgets import (FromWidget, ReadOnlyWidget, ButtonWidget,
from ietf.liaisons.models import LiaisonStatement, LiaisonStatementPurposeName
from ietf.liaisons.proxy import LiaisonDetailProxy
from ietf.group.models import Group
from ietf.person.models import Person
from ietf.person.models import Person, Email
from ietf.doc.models import Document
@ -313,6 +313,14 @@ class IncomingLiaisonForm(LiaisonForm):
self.fields['from_field'].choices = [('sdo_%s' % i.pk, i.name) for i in sdos.order_by("name")]
self.fields['from_field'].widget.submitter = unicode(self.person)
def set_replyto_field(self):
e = Email.objects.filter(person=self.person, role__group__state="active", role__name__in=["liaiman", "auth"])
if e:
addr = e[0].address
else:
addr = self.person.email_address()
self.fields['replyto'].initial = addr
def set_organization_field(self):
self.fields['organization'].choices = self.hm.get_all_incoming_entities()
@ -360,6 +368,14 @@ class OutgoingLiaisonForm(LiaisonForm):
self.fields['from_field'].widget.submitter = unicode(self.person)
self.fieldsets[0] = ('From', ('from_field', 'replyto', 'approved'))
def set_replyto_field(self):
e = Email.objects.filter(person=self.person, role__group__state="active", role__name__in=["ad", "chair"])
if e:
addr = e[0].address
else:
addr = self.person.email_address()
self.fields['replyto'].initial = addr
def set_organization_field(self):
# If the user is a liaison manager and is nothing more, reduce the To field to his SDOs
if not self.hm.get_entities_for_person(self.person) and is_sdo_liaison_manager(self.person):
@ -409,7 +425,7 @@ class OutgoingLiaisonForm(LiaisonForm):
# If the from entity is one in wich the user has full privileges the to entity could be anyone
if from_code in [i[0] for i in all_entities]:
return to_code
sdo_codes = ['sdo_%s' % i.pk for i in liaison_manager_sdos(self.person)]
sdo_codes = ['sdo_%s' % i.pk for i in liaison_manager_sdos(person)]
if to_code in sdo_codes:
return to_code
entity = self.get_to_entity()

View file

@ -136,7 +136,7 @@ class LiaisonDetailProxy(LiaisonStatement):
def from_sdo(self):
return self.from_group if self.from_group and self.from_group.type_id == "sdo" else None
def from_email(self):
self.from_contact.address
return self.from_contact.address
def get_absolute_url(self):
return '/liaison/%d/' % self.detail_id
class Meta:

View file

@ -53,19 +53,19 @@ class Meeting(models.Model):
@classmethod
def get_first_cut_off(cls):
date = cls.objects.all().order_by('-date')[0].date
date = cls.objects.all().filter(type="ietf").order_by('-date')[0].date
offset = datetime.timedelta(days=settings.FIRST_CUTOFF_DAYS)
return date - offset
@classmethod
def get_second_cut_off(cls):
date = cls.objects.all().order_by('-date')[0].date
date = cls.objects.all().filter(type="ietf").order_by('-date')[0].date
offset = datetime.timedelta(days=settings.SECOND_CUTOFF_DAYS)
return date - offset
@classmethod
def get_ietf_monday(cls):
date = cls.objects.all().order_by('-date')[0].date
date = cls.objects.all().filter(type="ietf").order_by('-date')[0].date
return date + datetime.timedelta(days=-date.weekday(), weeks=1)
# the various dates are currently computed