Converted leading tabs to spaces in ietf/**/*.py

- Legacy-Id: 16310
This commit is contained in:
Henrik Levkowetz 2019-06-27 14:51:02 +00:00
parent d7f5c84182
commit 3ec7e864be
25 changed files with 269 additions and 267 deletions

View file

@ -22,8 +22,8 @@ class DocumentChangesFeed(Feed):
return "Changes for %s" % obj.display_name()
def link(self, obj):
if obj is None:
raise FeedDoesNotExist
if obj is None:
raise FeedDoesNotExist
return urlreverse('ietf.doc.views_doc.document_history', kwargs=dict(name=obj.canonical_name()))
def subtitle(self, obj):
@ -32,7 +32,7 @@ class DocumentChangesFeed(Feed):
def items(self, obj):
events = obj.docevent_set.all().order_by("-time","-id")
augment_events_with_revision(obj, events)
return events
return events
def item_title(self, item):
return "[%s] %s [rev. %s]" % (item.by, truncatewords(strip_tags(item.desc), 15), item.rev)
@ -41,10 +41,10 @@ class DocumentChangesFeed(Feed):
return truncatewords_html(format_textarea(item.desc), 20)
def item_pubdate(self, item):
return item.time
return item.time
def item_author_name(self, item):
return str(item.by)
return str(item.by)
def item_link(self, item):
return urlreverse('ietf.doc.views_doc.document_history', kwargs=dict(name=item.doc.canonical_name())) + "#history-%s" % item.pk
@ -62,9 +62,9 @@ class InLastCallFeed(Feed):
d.lc_event = d.latest_event(LastCallDocEvent, type="sent_last_call")
docs = [d for d in docs if d.lc_event]
docs.sort(key=lambda d: d.lc_event.expires)
docs.sort(key=lambda d: d.lc_event.expires)
return docs
return docs
def item_title(self, item):
return "%s (%s - %s)" % (item.name,

View file

@ -33,15 +33,15 @@ def email_state_changed(request, doc, text, mailtrigger_id=None):
cc=cc)
def email_ad_approved_doc(request, doc, text):
to = "iesg@iesg.org"
bcc = "iesg-secretary@ietf.org"
frm = request.user.person.formatted_email()
send_mail(request, to, frm,
"Approved: %s" % doc.filename_with_rev(),
"doc/mail/ad_approval_email.txt",
dict(text=text,
docname=doc.filename_with_rev()),
bcc=bcc)
to = "iesg@iesg.org"
bcc = "iesg-secretary@ietf.org"
frm = request.user.person.formatted_email()
send_mail(request, to, frm,
"Approved: %s" % doc.filename_with_rev(),
"doc/mail/ad_approval_email.txt",
dict(text=text,
docname=doc.filename_with_rev()),
bcc=bcc)
def email_stream_changed(request, doc, old_stream, new_stream, text=""):
"""Email the change text to the notify group and to the stream chairs"""

View file

@ -146,8 +146,8 @@ def sanitize(value):
def square_brackets(value):
"""Adds square brackets around text."""
if isinstance(value, (bytes,str)):
if value == "":
value = " "
if value == "":
value = " "
return "[ %s ]" % value
elif value > 0:
return "[ X ]"

View file

@ -40,7 +40,7 @@ class ChangeStateTests(TestCase):
url = urlreverse('ietf.doc.views_draft.change_state', kwargs=dict(name=draft.name))
login_testing_unauthorized(self, "ad", url)
# normal get
r = self.client.get(url)
self.assertEqual(r.status_code, 200)

View file

@ -134,7 +134,7 @@ def change_state(request, name):
email_state_changed(request, doc, msg,'doc_state_edited')
if new_state.slug == "approved" and new_tags == [] and has_role(request.user, "Area Director"):
email_ad_approved_doc(request, doc, comment)
email_ad_approved_doc(request, doc, comment)
if prev_state and prev_state.slug in ("ann", "rfcqueue") and new_state.slug not in ("rfcqueue", "pub"):
email_pulled_from_rfc_queue(request, doc, comment, prev_state, new_state)
@ -578,7 +578,7 @@ def to_iesg(request,name):
doc.notify = notify
changes.append("State Change Notice email list changed to %s" % doc.notify)
# Get the last available writeup
# Get the last available writeup
previous_writeup = doc.latest_event(WriteupDocEvent,type="changed_protocol_writeup")
if previous_writeup != None:
changes.append(previous_writeup.text)
@ -904,7 +904,7 @@ def edit_shepherd_writeup(request, name):
writeup = form.cleaned_data['content']
e = WriteupDocEvent(doc=doc, rev=doc.rev, by=login, type="changed_protocol_writeup")
# Add the shepherd writeup to description if the document is in submitted for publication state
# Add the shepherd writeup to description if the document is in submitted for publication state
stream_state = doc.get_state("draft-stream-%s" % doc.stream_id)
iesg_state = doc.get_state("draft-iesg")
if (iesg_state or (stream_state and stream_state.slug=='sub-pub')):

View file

@ -21,12 +21,12 @@ class GroupChangesFeed(Feed):
return "Changes for %s %s" % (obj.acronym, obj.type)
def link(self, obj):
if not obj:
raise FeedDoesNotExist
if not obj:
raise FeedDoesNotExist
return obj.about_url()
def description(self, obj):
return self.title(obj)
return self.title(obj)
def items(self, obj):
events = list(obj.groupevent_set.all().select_related("group"))
@ -44,7 +44,7 @@ class GroupChangesFeed(Feed):
return obj.group.about_url()
def item_pubdate(self, obj):
return obj.time
return obj.time
def item_title(self, obj):
title = "%s - %s" % (truncatewords(strip_tags(obj.desc), 10), obj.by)

View file

@ -48,11 +48,11 @@ class StatusUpdateForm(forms.Form):
def clean(self):
if (self.cleaned_data['content'] and self.cleaned_data['content'].strip() and self.cleaned_data['txt']):
raise forms.ValidationError("Cannot enter both text box and TXT file")
elif (self.cleaned_data['content'] and not self.cleaned_data['content'].strip() and not self.cleaned_data['txt']):
raise forms.ValidationError("Cannot enter both text box and TXT file")
elif (self.cleaned_data['content'] and not self.cleaned_data['content'].strip() and not self.cleaned_data['txt']):
raise forms.ValidationError("NULL input is not a valid option")
elif (self.cleaned_data['txt'] and not self.cleaned_data['txt'].strip()) :
raise forms.ValidationError("NULL TXT file input is not a valid option")
raise forms.ValidationError("NULL TXT file input is not a valid option")
class ConcludeGroupForm(forms.Form):
instructions = forms.CharField(widget=forms.Textarea(attrs={'rows': 30}), required=True, strip=False)

View file

@ -12,14 +12,14 @@ from datetime import datetime
def forward(apps, schema_editor):
p=Person.objects.filter(name="Jim Fenton")[0]
p=Person.objects.filter(name="Jim Fenton")[0]
# Unfortunately, get_nomcom_by_year only works for 2013 and later, so we need to do things the hard way.
n = Group.objects.filter(acronym="nomcom2002")[0]
n = Group.objects.filter(acronym="nomcom2002")[0]
n.message_set.create(by=p, subject="nomcom call for volunteers", time=datetime(2002,7,30),
frm="Phil Roberts <PRoberts@MEGISTO.com>", to="IETF Announcement list <ietf-announce@ietf.org>", body="""
n.message_set.create(by=p, subject="nomcom call for volunteers", time=datetime(2002,7,30),
frm="Phil Roberts <PRoberts@MEGISTO.com>", to="IETF Announcement list <ietf-announce@ietf.org>", body="""
This is the call for volunteers to participate in the 2002 IETF
Nominations Committee, the committee that will select this year's
nominees for the IAB and the IESG. Details about the Nominations
@ -116,8 +116,8 @@ Nordstrom (JWN)
""")
n.message_set.create(by=p, subject="Selection of the Nominations Committee", time=datetime(2002,9,17),
frm="Phil Roberts <PRoberts@MEGISTO.com>", to="IETF Announcement list <ietf-announce@ietf.org>", body="""
n.message_set.create(by=p, subject="Selection of the Nominations Committee", time=datetime(2002,9,17),
frm="Phil Roberts <PRoberts@MEGISTO.com>", to="IETF Announcement list <ietf-announce@ietf.org>", body="""
STOCKS USED IN THE NOMCOM SELECTION PROCESS, published result (in 100s),
number used as input (using 000s, rounded):
@ -225,10 +225,10 @@ Nominations committee:
140. Eva Gustaffson
"""
)
)
n.message_set.create(by=p, subject="Announcement of the Nominations Committee", time=datetime(2002,9,18),
frm="Phil Roberts <PRoberts@MEGISTO.com>", to="IETF Announcement list <ietf-announce@ietf.org>", body="""
n.message_set.create(by=p, subject="Announcement of the Nominations Committee", time=datetime(2002,9,18),
frm="Phil Roberts <PRoberts@MEGISTO.com>", to="IETF Announcement list <ietf-announce@ietf.org>", body="""
We have completed selection of the 2002
Nominations committee.
@ -256,10 +256,10 @@ Theodore Ts'o <tytso@mit.edu> (previous nomcom chair)
Information on this year's selection process is available at:
<http://www.ietf.org/nomcom/select-announce.txt>
"""
)
)
n.message_set.create(by=p, subject="Announcement of IESG and IAB Nominations Requests", time=datetime(2002,10,21),
frm="Phil Roberts <PRoberts@MEGISTO.com>", to="IETF Announcement list <ietf-announce@ietf.org>", body="""
n.message_set.create(by=p, subject="Announcement of IESG and IAB Nominations Requests", time=datetime(2002,10,21),
frm="Phil Roberts <PRoberts@MEGISTO.com>", to="IETF Announcement list <ietf-announce@ietf.org>", body="""
The 2002-2003 Nominations Committee is now
soliciting nominations for the open
slots on the IESG and IAB.
@ -343,8 +343,8 @@ also serves as a non-voting liaison.
""")
n.message_set.create(by=p, subject="Announcement of IESG and IAB Nominations Requests", time=datetime(2002,11,0o5),
frm="Phil Roberts <PRoberts@MEGISTO.com>", to="IETF Announcement list <ietf-announce@ietf.org>", body="""
n.message_set.create(by=p, subject="Announcement of IESG and IAB Nominations Requests", time=datetime(2002,11,0o5),
frm="Phil Roberts <PRoberts@MEGISTO.com>", to="IETF Announcement list <ietf-announce@ietf.org>", body="""
The 2002-2003 Nominations Committee is now
soliciting nominations for the open
slots on the IESG and IAB.
@ -430,8 +430,8 @@ open position. The Chair of the prior year's nominating committee
also serves as a non-voting liaison.
""")
n.message_set.create(by=p, subject="Announcement of IESG and IAB Nominations Requests", time=datetime(2002,11,12),
frm="Phil Roberts <PRoberts@MEGISTO.com>", to="IETF Announcement list <ietf-announce@ietf.org>", body="""
n.message_set.create(by=p, subject="Announcement of IESG and IAB Nominations Requests", time=datetime(2002,11,12),
frm="Phil Roberts <PRoberts@MEGISTO.com>", to="IETF Announcement list <ietf-announce@ietf.org>", body="""
The 2002-2003 Nominations Committee is now
soliciting nominations for the open
slots on the IESG and IAB.
@ -516,10 +516,10 @@ committee from their current membership who are not sitting in an
open position. The Chair of the prior year's nominating committee
also serves as a non-voting liaison.
"""
)
)
n.message_set.create(by=p, subject="IETF Nomcom Announcement", time=datetime(2003,2,27),
frm="Phil Roberts <PRoberts@MEGISTO.com>", to="IETF Announcement list <ietf-announce@ietf.org>", body="""
n.message_set.create(by=p, subject="IETF Nomcom Announcement", time=datetime(2003,2,27),
frm="Phil Roberts <PRoberts@MEGISTO.com>", to="IETF Announcement list <ietf-announce@ietf.org>", body="""
The nomcom is pleased to announce the results of the 2002-2003
selection process. The IAB has approved the IESG candidates and
the ISOC has approved the IAB candidates. Please welcome them
@ -581,8 +581,8 @@ Eric Rescorla - IAB liaison
Ted Ts'o - past chair
""")
n.message_set.create(by=p, subject="Announcement of IESG and IAB Nominations Request", time=datetime(2003,6,11),
frm="Phil Roberts <PRoberts@MEGISTO.com>", to="IETF Announcement list <ietf-announce@ietf.org>", body="""
n.message_set.create(by=p, subject="Announcement of IESG and IAB Nominations Request", time=datetime(2003,6,11),
frm="Phil Roberts <PRoberts@MEGISTO.com>", to="IETF Announcement list <ietf-announce@ietf.org>", body="""
The nominations committee has received notice to fill the vacancy in the
Internet Area created with Erik Nordmark's departure. The nominations
committee is seeking nominees to fill the open position. The chosen
@ -641,8 +641,8 @@ Ted Ts'o - past chair
also serves as a non-voting liaison.
""")
n.message_set.create(by=p, subject="Nomcom result announcement", time=datetime(2003,7,15),
frm="Phil Roberts <PRoberts@MEGISTO.com>", to="IETF Announcement list <ietf-announce@ietf.org>", body="""
n.message_set.create(by=p, subject="Nomcom result announcement", time=datetime(2003,7,15),
frm="Phil Roberts <PRoberts@MEGISTO.com>", to="IETF Announcement list <ietf-announce@ietf.org>", body="""
The nomcom is pleased to announce that it has selected Margaret Wasserman
to fill the mid-term vacancy left by Erik Nordmark's resignation.
@ -681,10 +681,10 @@ Ted Ts'o - past chair
Ted Ts'o - past chair
""")
n = Group.objects.filter(acronym="nomcom2003")[0]
n = Group.objects.filter(acronym="nomcom2003")[0]
n.message_set.create(by=p, subject="IETF Nominations Committee Chair Announcement", time=datetime(2003,8,25),
frm="Lynn St. Amour", to="IETF Announcement list <ietf-announce@ietf.org>", body="""
n.message_set.create(by=p, subject="IETF Nominations Committee Chair Announcement", time=datetime(2003,8,25),
frm="Lynn St. Amour", to="IETF Announcement list <ietf-announce@ietf.org>", body="""
One of the roles of the ISOC President is to appoint the IETF Nominations
Committee chair. This is done through consultation with the IETF and IAB Chairs
as well as the ISOC Executive Committee and it gives us great pleasure to announce
@ -706,8 +706,8 @@ President & CEO
The Internet Society
""")
n.message_set.create(by=p, subject="NomCom call for volunteers", time=datetime(2003,9,22),
frm="Richard Draves <richdr@microsoft.com>", to="IETF Announcement list <ietf-announce@ietf.org>", body="""
n.message_set.create(by=p, subject="NomCom call for volunteers", time=datetime(2003,9,22),
frm="Richard Draves <richdr@microsoft.com>", to="IETF Announcement list <ietf-announce@ietf.org>", body="""
This is the call for volunteers to participate in the 2003 IETF Nominations Committee,
the committee that will select this year's nominees for the IAB and the IESG.
@ -797,8 +797,8 @@ Corning (GLW)
Tyco International (TYC)
""")
n.message_set.create(by=p, subject="NomCom volunteer list", time=datetime(2003,10,6),
frm="Richard Draves <richdr@microsoft.com>", to="IETF Announcement list <ietf-announce@ietf.org>", body="""
n.message_set.create(by=p, subject="NomCom volunteer list", time=datetime(2003,10,6),
frm="Richard Draves <richdr@microsoft.com>", to="IETF Announcement list <ietf-announce@ietf.org>", body="""
The final list of volunteers for the 2003 NomCom can be found at
http://www.ietf.org/nomcom. I would like to thank everyone who
volunteered.
@ -845,8 +845,8 @@ Corning (GLW)
Tyco International (TYC)
""")
n.message_set.create(by=p, subject="Selection of the Nominations Committee", time=datetime(2003,10,10),
frm="Richard Draves <richdr@microsoft.com>", to="IETF Announcement list <ietf-announce@ietf.org>", body="""
n.message_set.create(by=p, subject="Selection of the Nominations Committee", time=datetime(2003,10,10),
frm="Richard Draves <richdr@microsoft.com>", to="IETF Announcement list <ietf-announce@ietf.org>", body="""
STOCKS USED IN THE NOMCOM SELECTION PROCESS, published result (in 100s),
number used as input (using 000s, rounded):
@ -972,8 +972,8 @@ Nominations committee:
108. Andrew Thiessen <Andrew@its.bldrdoc.gov>
""")
n.message_set.create(by=p, subject="NomCom Selection", time=datetime(2003,10,10),
frm="Richard Draves <richdr@microsoft.com>", to="IETF Announcement list <ietf-announce@ietf.org>", body="""
n.message_set.create(by=p, subject="NomCom Selection", time=datetime(2003,10,10),
frm="Richard Draves <richdr@microsoft.com>", to="IETF Announcement list <ietf-announce@ietf.org>", body="""
Please welcome the voting members of this year's nomcom:
Kireeti Kompella <kireeti@juniper.net>
@ -1010,8 +1010,8 @@ Thanks,
Rich
""")
n.message_set.create(by=p, subject="Call for Nominees", time=datetime(2003,10,17),
frm="Richard Draves <richdr@microsoft.com>", to="IETF Announcement list <ietf-announce@ietf.org>", body="""
n.message_set.create(by=p, subject="Call for Nominees", time=datetime(2003,10,17),
frm="Richard Draves <richdr@microsoft.com>", to="IETF Announcement list <ietf-announce@ietf.org>", body="""
Please send the NomCom <nomcom@ietf.org> nominations for the open IESG
and IAB positions:
@ -1042,8 +1042,8 @@ Thanks,
Rich
""")
n.message_set.create(by=p, subject="NomCom members", time=datetime(2003,10,24),
frm="Richard Draves <richdr@microsoft.com>", to="IETF Announcement list <ietf-announce@ietf.org>", body="""
n.message_set.create(by=p, subject="NomCom members", time=datetime(2003,10,24),
frm="Richard Draves <richdr@microsoft.com>", to="IETF Announcement list <ietf-announce@ietf.org>", body="""
AB has appointed Geoff Huston as its non-voting liaison to the
nomcom.
@ -1075,8 +1075,8 @@ Thanks,
Rich
""")
n.message_set.create(by=p, subject="NomCom at IETF", time=datetime(2003,11,7),
frm="Richard Draves <richdr@microsoft.com>", to="IETF Announcement list <ietf-announce@ietf.org>", body="""
n.message_set.create(by=p, subject="NomCom at IETF", time=datetime(2003,11,7),
frm="Richard Draves <richdr@microsoft.com>", to="IETF Announcement list <ietf-announce@ietf.org>", body="""
Members of the nomcom at IETF will be happy to chat with you in person
about what the nomcom should look for in candidates for the IESG and
IAB, specific feedback about the incumbents or potential nominees,
@ -1095,8 +1095,8 @@ Thanks,
Rich
""")
n.message_set.create(by=p, subject="NomCom News", time=datetime(2003,11,14),
frm="Richard Draves <richdr@microsoft.com>", to="IETF Announcement list <ietf-announce@ietf.org>", body="""
n.message_set.create(by=p, subject="NomCom News", time=datetime(2003,11,14),
frm="Richard Draves <richdr@microsoft.com>", to="IETF Announcement list <ietf-announce@ietf.org>", body="""
Randy Bush has resigned from his position as O&M Area Director. Hence,
the nomcom will be filling Randy's position in addition to the
previously announced positions.
@ -1120,8 +1120,8 @@ Thanks,
Rich
""")
n.message_set.create(by=p, subject="reminder - nominations to replace Randy Bush", time=datetime(2003,11,26),
frm="Richard Draves <richdr@microsoft.com>", to="IETF Announcement list <ietf-announce@ietf.org>", body="""
n.message_set.create(by=p, subject="reminder - nominations to replace Randy Bush", time=datetime(2003,11,26),
frm="Richard Draves <richdr@microsoft.com>", to="IETF Announcement list <ietf-announce@ietf.org>", body="""
At IETF Randy Bush resigned from his position as Operations & Management
Area Director for the IETF. This creates a mid-term vacancy that the
IETF NomCom needs to fill. Randy's replacement will have a one-year
@ -1144,8 +1144,8 @@ Thanks,
Rich
""")
n.message_set.create(by=p, subject="Randy Bush replacement schedule", time=datetime(2003,12,1),
frm="Richard Draves <richdr@microsoft.com>", to="IETF Announcement list <ietf-announce@ietf.org>", body="""
n.message_set.create(by=p, subject="Randy Bush replacement schedule", time=datetime(2003,12,1),
frm="Richard Draves <richdr@microsoft.com>", to="IETF Announcement list <ietf-announce@ietf.org>", body="""
For mid-term vacancies, RFC 2727 says "the selection and confirmation
process is expected to be completed within 1 month." However, there are
several factors that make a one-month schedule impractical in this
@ -1171,8 +1171,8 @@ Thanks,
Rich
""")
n.message_set.create(by=p, subject="Randy Bush replacement", time=datetime(2004,1,14),
frm="Richard Draves <richdr@microsoft.com>", to="IETF Announcement list <ietf-announce@ietf.org>", body="""
n.message_set.create(by=p, subject="Randy Bush replacement", time=datetime(2004,1,14),
frm="Richard Draves <richdr@microsoft.com>", to="IETF Announcement list <ietf-announce@ietf.org>", body="""
I am pleased to announce that the IAB has confirmed the NomCom's
selection of David Kessens for a one-year term as O&M Area Director,
filling the mid-term vacancy left by Randy Bush's resignation.
@ -1181,8 +1181,8 @@ Thanks,
Rich
""")
n.message_set.create(by=p, subject="NomCom results", time=datetime(2004,2,13),
frm="Richard Draves <richdr@microsoft.com>", to="IETF Announcement list <ietf-announce@ietf.org>", body="""
n.message_set.create(by=p, subject="NomCom results", time=datetime(2004,2,13),
frm="Richard Draves <richdr@microsoft.com>", to="IETF Announcement list <ietf-announce@ietf.org>", body="""
I am pleased to announce the results of the 2003-2004 NomCom selection
process. The IAB has approved the IESG candidates and the ISOC board has
approved the IAB candidates. Please welcome them in their roles:
@ -1241,8 +1241,8 @@ Thanks,
Rich
""")
n.message_set.create(by=p, subject="call for Security AD nominations", time=datetime(2004,9,28),
frm="Richard Draves <richdr@microsoft.com>", to="IETF Announcement list <ietf-announce@ietf.org>", body="""
n.message_set.create(by=p, subject="call for Security AD nominations", time=datetime(2004,9,28),
frm="Richard Draves <richdr@microsoft.com>", to="IETF Announcement list <ietf-announce@ietf.org>", body="""
Steve Bellovin has resigned from his position as Security Area Director,
effective the end of the November IETF meeting. The IESG has asked the
2003-2004 NomCom to fill the mid-term vacancy. Steve's replacement will
@ -1266,8 +1266,8 @@ Thanks,
Rich
""")
n.message_set.create(by=p, subject="Steve Bellovin replacement", time=datetime(2004,11,7),
frm="Richard Draves <richdr@microsoft.com>", to="IETF Announcement list <ietf-announce@ietf.org>", body="""
n.message_set.create(by=p, subject="Steve Bellovin replacement", time=datetime(2004,11,7),
frm="Richard Draves <richdr@microsoft.com>", to="IETF Announcement list <ietf-announce@ietf.org>", body="""
I am pleased to announce that the IAB has confirmed the NomCom's
selection of Sam Hartman for a one-year term as Security Area Director,
filling the mid-term vacancy left by Steve Bellovin's resignation.
@ -1281,20 +1281,20 @@ Thanks,
Rich
""")
return
return
def reverse(apps, schema_editor):
n = Group.objects.filter(acronym="nomcom2002")[0]
n = Group.objects.filter(acronym="nomcom2002")[0]
announcements = Message.objects.filter(related_groups=n)
announcements.delete()
announcements = Message.objects.filter(related_groups=n)
announcements.delete()
n = Group.objects.filter(acronym="nomcom2003")[0]
announcements = Message.objects.filter(related_groups=n)
announcements.delete()
n = Group.objects.filter(acronym="nomcom2003")[0]
announcements = Message.objects.filter(related_groups=n)
announcements.delete()
return
return
class Migration(migrations.Migration):
@ -1304,5 +1304,5 @@ class Migration(migrations.Migration):
]
operations = [
migrations.RunPython(forward, reverse)
migrations.RunPython(forward, reverse)
]

View file

@ -349,7 +349,7 @@ class ReviewTests(TestCase):
'start_date': start_date.isoformat(),
'end_date': "",
'availability': "unavailable",
'reason': "Whimsy",
'reason': "Whimsy",
})
self.assertEqual(r.status_code, 302)
period = UnavailablePeriod.objects.get(person=reviewer, team=review_req.team, start_date=start_date)
@ -359,7 +359,7 @@ class ReviewTests(TestCase):
msg_content = outbox[0].get_payload(decode=True).decode("utf-8").lower()
self.assertTrue(start_date.isoformat(), msg_content)
self.assertTrue("indefinite", msg_content)
self.assertEqual(period.reason, "Whimsy")
self.assertEqual(period.reason, "Whimsy")
# end unavailable period
empty_outbox()

View file

@ -337,8 +337,8 @@ def active_programs(request):
return render(request, 'group/active_programs.html', {'programs' : programs })
def active_areas(request):
areas = Group.objects.filter(type="area", state="active").order_by("name")
return render(request, 'group/active_areas.html', {'areas': areas })
areas = Group.objects.filter(type="area", state="active").order_by("name")
return render(request, 'group/active_areas.html', {'areas': areas })
def active_wgs(request):
areas = Group.objects.filter(type="area", state="active").order_by("name")
@ -1692,7 +1692,7 @@ def change_reviewer_settings(request, acronym, reviewer_email, group_type=None):
period.start_date.isoformat() if period.start_date else "indefinite",
period.end_date.isoformat() if period.end_date else "indefinite",
period.get_availability_display(),
period.reason,
period.reason,
)
if period.availability == "unavailable":

View file

@ -1,3 +1,4 @@
# Copyright The IETF Trust 2007-2019, All Rights Reserved
import datetime
from django.contrib.syndication.views import Feed
@ -26,7 +27,7 @@ class IESGAgendaFeed(Feed):
return doc.latest_telechat_event.time
def item_author_name(self, doc):
return doc.ad.plain_name() if doc.ad else "None"
return doc.ad.plain_name() if doc.ad else "None"
def item_author_email(self, doc):
if not doc.ad:

View file

@ -48,24 +48,24 @@ def has_role(user, role_names, *args, **kwargs):
return False
role_qs = {
"Area Director": Q(person=person, name__in=("pre-ad", "ad"), group__type="area", group__state="active"),
"Secretariat": Q(person=person, name="secr", group__acronym="secretariat"),
"Area Director": Q(person=person, name__in=("pre-ad", "ad"), group__type="area", group__state="active"),
"Secretariat": Q(person=person, name="secr", group__acronym="secretariat"),
"IAB" : Q(person=person, name="member", group__acronym="iab"),
"IANA": Q(person=person, name="auth", group__acronym="iana"),
"IANA": Q(person=person, name="auth", group__acronym="iana"),
"RFC Editor": Q(person=person, name="auth", group__acronym="rfceditor"),
"ISE" : Q(person=person, name="chair", group__acronym="ise"),
"IAD": Q(person=person, name="admdir", group__acronym="ietf"),
"IETF Chair": Q(person=person, name="chair", group__acronym="ietf"),
"IETF Trust Chair": Q(person=person, name="chair", group__acronym="ietf-trust"),
"IRTF Chair": Q(person=person, name="chair", group__acronym="irtf"),
"IAB Chair": Q(person=person, name="chair", group__acronym="iab"),
"IAB Executive Director": Q(person=person, name="execdir", group__acronym="iab"),
"IAD": Q(person=person, name="admdir", group__acronym="ietf"),
"IETF Chair": Q(person=person, name="chair", group__acronym="ietf"),
"IETF Trust Chair": Q(person=person, name="chair", group__acronym="ietf-trust"),
"IRTF Chair": Q(person=person, name="chair", group__acronym="irtf"),
"IAB Chair": Q(person=person, name="chair", group__acronym="iab"),
"IAB Executive Director": Q(person=person, name="execdir", group__acronym="iab"),
"IAB Group Chair": Q(person=person, name="chair", group__type="iab", group__state="active"),
"IAOC Chair": Q(person=person, name="chair", group__acronym="iaoc"),
"WG Chair": Q(person=person,name="chair", group__type="wg", group__state__in=["active","bof", "proposed"]),
"WG Secretary": Q(person=person,name="secr", group__type="wg", group__state__in=["active","bof", "proposed"]),
"RG Chair": Q(person=person,name="chair", group__type="rg", group__state__in=["active","proposed"]),
"RG Secretary": Q(person=person,name="secr", group__type="rg", group__state__in=["active","proposed"]),
"WG Chair": Q(person=person,name="chair", group__type="wg", group__state__in=["active","bof", "proposed"]),
"WG Secretary": Q(person=person,name="secr", group__type="wg", group__state__in=["active","bof", "proposed"]),
"RG Chair": Q(person=person,name="chair", group__type="rg", group__state__in=["active","proposed"]),
"RG Secretary": Q(person=person,name="secr", group__type="rg", group__state__in=["active","proposed"]),
"AG Secretary": Q(person=person,name="secr", group__type="ag", group__state__in=["active"]),
"Team Chair": Q(person=person,name="chair", group__type="team", group__state="active"),
"Nomcom Chair": Q(person=person, name="chair", group__type="nomcom", group__acronym__icontains=kwargs.get('year', '0000')),

View file

@ -79,7 +79,7 @@ class LiaisonStatementsFeed(Feed):
qs = qs.prefetch_related("attachments")
return qs
return qs
def title(self, obj):
return obj['title']

View file

@ -10,64 +10,64 @@ def backfill_old_meetings(apps, schema_editor):
for id, number, type_id, date, city, country, time_zone, continent, attendees in [
( 59,'59','ietf','2004-03-29','Seoul','KR','Asia/Seoul','Asia','1390' ),
( 58,'58','ietf','2003-11-09','Minneapolis','US','America/Menominee','America','1233' ),
( 57,'57','ietf','2003-07-13','Vienna','AT','Europe/Vienna','Europe','1304' ),
( 56,'56','ietf','2003-03-16','San Francisco','US','America/Los_Angeles','America','1679' ),
( 55,'55','ietf','2002-11-17','Atlanta','US','America/New_York','America','1570' ),
( 54,'54','ietf','2002-07-14','Yokohama','JP','Asia/Tokyo','Asia','1885' ),
( 53,'53','ietf','2002-03-17','Minneapolis','US','America/Menominee','America','1656' ),
( 52,'52','ietf','2001-12-09','Salt Lake City','US','America/Denver','America','1691' ),
( 51,'51','ietf','2001-08-05','London','GB','Europe/London','Europe','2226' ),
( 50,'50','ietf','2001-03-18','Minneapolis','US','America/Menominee','America','1822' ),
( 49,'49','ietf','2000-12-10','San Diego','US','America/Los_Angeles','America','2810' ),
( 48,'48','ietf','2000-07-31','Pittsburgh','US','America/New_York','America','2344' ),
( 47,'47','ietf','2000-03-26','Adelaide','AU','Australia/Adelaide','Australia','1431' ),
( 46,'46','ietf','1999-11-07','Washington','US','America/New_York','America','2379' ),
( 45,'45','ietf','1999-07-11','Oslo','NO','Europe/Oslo','Europe','1710' ),
( 44,'44','ietf','1999-03-14','Minneapolis','US','America/Menominee','America','1705' ),
( 43,'43','ietf','1998-12-07','Orlando','US','America/New_York','America','2124' ),
( 42,'42','ietf','1998-08-24','Chicago','US','America/Chicago','America','2106' ),
( 41,'41','ietf','1998-03-30','Los Angeles','US','America/Los_Angeles','America','1775' ),
( 40,'40','ietf','1997-12-08','Washington','US','America/New_York','America','1897' ),
( 39,'39','ietf','1997-08-11','Munich','DE','Europe/Berlin','Europe','1308' ),
( 38,'38','ietf','1997-04-07','Memphis','US','America/Chicago','America','1321' ),
( 37,'37','ietf','1996-12-09','San Jose','US','America/Los_Angeles','America','1993' ),
( 36,'36','ietf','1996-06-24','Montreal','CA','America/New_York','America','1283' ),
( 35,'35','ietf','1996-03-04','Los Angeles','US','America/Los_Angeles','America','1038' ),
( 34,'34','ietf','1995-12-04','Dallas','US','America/Chicago','America','1007' ),
( 33,'33','ietf','1995-07-17','Stockholm','SE','Europe/Stockholm','Europe','617' ),
( 32,'32','ietf','1995-04-03','Danvers','US','America/New_York','America','983' ),
( 31,'31','ietf','1994-12-05','San Jose','US','America/Los_Angeles','America','1079' ),
( 30,'30','ietf','1994-07-25','Toronto','CA','America/New_York','America','710' ),
( 29,'29','ietf','1994-03-28','Seattle','US','America/Los_Angeles','America','785' ),
( 28,'28','ietf','1993-11-01','Houston','US','America/Chicago','America','636' ),
( 27,'27','ietf','1993-07-12','Amsterdam','NL','Europe/Amsterdam','Europe','493' ),
( 26,'26','ietf','1993-03-29','Columbus','US','America/New_York','America','638' ),
( 25,'25','ietf','1992-11-16','Washington','US','America/New_York','America','633' ),
( 24,'24','ietf','1992-07-13','Cambridge','US','America/New_York','America','677' ),
( 23,'23','ietf','1992-03-16','San Diego','US','America/Los_Angeles','America','530' ),
( 22,'22','ietf','1991-11-18','Santa Fe','US','America/Denver','America','372' ),
( 21,'21','ietf','1991-07-29','Atlanta','US','America/New_York','America','387' ),
( 20,'20','ietf','1991-03-11','St. Louis','US','America/Chicago','America','348' ),
( 19,'19','ietf','1990-12-03','Boulder','US','America/Denver','America','292' ),
( 18,'18','ietf','1990-07-30','Vancouver','CA','America/Los_Angeles','America','293' ),
( 17,'17','ietf','1990-05-01','Pittsburgh','US','America/New_York','America','244' ),
( 16,'16','ietf','1990-02-06','Tallahassee','US','America/New_York','America','196' ),
( 15,'15','ietf','1989-10-31','Honolulu','US','Pacific/Honolulu','America','138' ),
( 14,'14','ietf','1989-07-25','Stanford','US','America/Los_Angeles','America','217' ),
( 13,'13','ietf','1989-04-11','Cocoa Beach','US','America/New_York','America','114' ),
( 12,'12','ietf','1989-01-18','Austin','US','America/Chicago','America','120' ),
( 11,'11','ietf','1988-10-17','Ann Arbor','US','America/New_York','America','114' ),
( 10,'10','ietf','1988-06-15','Annapolis','US','America/New_York','America','112' ),
( 9,'9','ietf','1988-03-01','San Diego','US','America/Los_Angeles','America','82' ),
( 8,'8','ietf','1987-11-02','Boulder','US','America/Denver','America','56' ),
( 7,'7','ietf','1987-07-27','McLean','US','America/New_York','America','101' ),
( 6,'6','ietf','1987-04-22','Boston','US','America/New_York','America','88' ),
( 5,'5','ietf','1987-02-04','Moffett Field','US','America/Los_Angeles','America','35' ),
( 4,'4','ietf','1986-10-15','Menlo Park','US','America/Los_Angeles','America','35' ),
( 3,'3','ietf','1986-07-23','Ann Arbor','US','America/New_York','America','18' ),
( 2,'2','ietf','1986-04-08','Aberdeen','US','America/New_York','America','21' ),
( 1,'1','ietf','1986-01-16','San Diego','US','America/Los_Angeles','America','21' ),
( 58,'58','ietf','2003-11-09','Minneapolis','US','America/Menominee','America','1233' ),
( 57,'57','ietf','2003-07-13','Vienna','AT','Europe/Vienna','Europe','1304' ),
( 56,'56','ietf','2003-03-16','San Francisco','US','America/Los_Angeles','America','1679' ),
( 55,'55','ietf','2002-11-17','Atlanta','US','America/New_York','America','1570' ),
( 54,'54','ietf','2002-07-14','Yokohama','JP','Asia/Tokyo','Asia','1885' ),
( 53,'53','ietf','2002-03-17','Minneapolis','US','America/Menominee','America','1656' ),
( 52,'52','ietf','2001-12-09','Salt Lake City','US','America/Denver','America','1691' ),
( 51,'51','ietf','2001-08-05','London','GB','Europe/London','Europe','2226' ),
( 50,'50','ietf','2001-03-18','Minneapolis','US','America/Menominee','America','1822' ),
( 49,'49','ietf','2000-12-10','San Diego','US','America/Los_Angeles','America','2810' ),
( 48,'48','ietf','2000-07-31','Pittsburgh','US','America/New_York','America','2344' ),
( 47,'47','ietf','2000-03-26','Adelaide','AU','Australia/Adelaide','Australia','1431' ),
( 46,'46','ietf','1999-11-07','Washington','US','America/New_York','America','2379' ),
( 45,'45','ietf','1999-07-11','Oslo','NO','Europe/Oslo','Europe','1710' ),
( 44,'44','ietf','1999-03-14','Minneapolis','US','America/Menominee','America','1705' ),
( 43,'43','ietf','1998-12-07','Orlando','US','America/New_York','America','2124' ),
( 42,'42','ietf','1998-08-24','Chicago','US','America/Chicago','America','2106' ),
( 41,'41','ietf','1998-03-30','Los Angeles','US','America/Los_Angeles','America','1775' ),
( 40,'40','ietf','1997-12-08','Washington','US','America/New_York','America','1897' ),
( 39,'39','ietf','1997-08-11','Munich','DE','Europe/Berlin','Europe','1308' ),
( 38,'38','ietf','1997-04-07','Memphis','US','America/Chicago','America','1321' ),
( 37,'37','ietf','1996-12-09','San Jose','US','America/Los_Angeles','America','1993' ),
( 36,'36','ietf','1996-06-24','Montreal','CA','America/New_York','America','1283' ),
( 35,'35','ietf','1996-03-04','Los Angeles','US','America/Los_Angeles','America','1038' ),
( 34,'34','ietf','1995-12-04','Dallas','US','America/Chicago','America','1007' ),
( 33,'33','ietf','1995-07-17','Stockholm','SE','Europe/Stockholm','Europe','617' ),
( 32,'32','ietf','1995-04-03','Danvers','US','America/New_York','America','983' ),
( 31,'31','ietf','1994-12-05','San Jose','US','America/Los_Angeles','America','1079' ),
( 30,'30','ietf','1994-07-25','Toronto','CA','America/New_York','America','710' ),
( 29,'29','ietf','1994-03-28','Seattle','US','America/Los_Angeles','America','785' ),
( 28,'28','ietf','1993-11-01','Houston','US','America/Chicago','America','636' ),
( 27,'27','ietf','1993-07-12','Amsterdam','NL','Europe/Amsterdam','Europe','493' ),
( 26,'26','ietf','1993-03-29','Columbus','US','America/New_York','America','638' ),
( 25,'25','ietf','1992-11-16','Washington','US','America/New_York','America','633' ),
( 24,'24','ietf','1992-07-13','Cambridge','US','America/New_York','America','677' ),
( 23,'23','ietf','1992-03-16','San Diego','US','America/Los_Angeles','America','530' ),
( 22,'22','ietf','1991-11-18','Santa Fe','US','America/Denver','America','372' ),
( 21,'21','ietf','1991-07-29','Atlanta','US','America/New_York','America','387' ),
( 20,'20','ietf','1991-03-11','St. Louis','US','America/Chicago','America','348' ),
( 19,'19','ietf','1990-12-03','Boulder','US','America/Denver','America','292' ),
( 18,'18','ietf','1990-07-30','Vancouver','CA','America/Los_Angeles','America','293' ),
( 17,'17','ietf','1990-05-01','Pittsburgh','US','America/New_York','America','244' ),
( 16,'16','ietf','1990-02-06','Tallahassee','US','America/New_York','America','196' ),
( 15,'15','ietf','1989-10-31','Honolulu','US','Pacific/Honolulu','America','138' ),
( 14,'14','ietf','1989-07-25','Stanford','US','America/Los_Angeles','America','217' ),
( 13,'13','ietf','1989-04-11','Cocoa Beach','US','America/New_York','America','114' ),
( 12,'12','ietf','1989-01-18','Austin','US','America/Chicago','America','120' ),
( 11,'11','ietf','1988-10-17','Ann Arbor','US','America/New_York','America','114' ),
( 10,'10','ietf','1988-06-15','Annapolis','US','America/New_York','America','112' ),
( 9,'9','ietf','1988-03-01','San Diego','US','America/Los_Angeles','America','82' ),
( 8,'8','ietf','1987-11-02','Boulder','US','America/Denver','America','56' ),
( 7,'7','ietf','1987-07-27','McLean','US','America/New_York','America','101' ),
( 6,'6','ietf','1987-04-22','Boston','US','America/New_York','America','88' ),
( 5,'5','ietf','1987-02-04','Moffett Field','US','America/Los_Angeles','America','35' ),
( 4,'4','ietf','1986-10-15','Menlo Park','US','America/Los_Angeles','America','35' ),
( 3,'3','ietf','1986-07-23','Ann Arbor','US','America/New_York','America','18' ),
( 2,'2','ietf','1986-04-08','Aberdeen','US','America/New_York','America','21' ),
( 1,'1','ietf','1986-01-16','San Diego','US','America/Los_Angeles','America','21' ),
]:
Meeting.objects.get_or_create(id=id, number=number, type_id=type_id,
date=date, city=city, country=country,

View file

@ -14,9 +14,9 @@ import unicodedata
def sql_log_middleware(get_response):
def sql_log(request):
response = get_response(request)
for q in connection.queries:
if re.match('(update|insert)', q['sql'], re.IGNORECASE):
log(q['sql'])
for q in connection.queries:
if re.match('(update|insert)', q['sql'], re.IGNORECASE):
log(q['sql'])
return response
return sql_log
@ -26,11 +26,11 @@ class SMTPExceptionMiddleware(object):
def __call__(self, request):
return self.get_response(request)
def process_exception(self, request, exception):
if isinstance(exception, smtplib.SMTPException):
if isinstance(exception, smtplib.SMTPException):
(extype, value, tb) = log_smtp_exception(exception)
return render(request, 'email_failed.html',
return render(request, 'email_failed.html',
{'exception': extype, 'args': value, 'traceback': "".join(tb)} )
return None
return None
class Utf8ExceptionMiddleware(object):
def __init__(self, get_response):
@ -38,20 +38,20 @@ class Utf8ExceptionMiddleware(object):
def __call__(self, request):
return self.get_response(request)
def process_exception(self, request, exception):
if isinstance(exception, OperationalError):
if isinstance(exception, OperationalError):
extype, value, tb = exc_parts()
if value[0] == 1366:
log("Database 4-byte utf8 exception: %s: %s" % (extype, value))
return render(request, 'utf8_4byte_failed.html',
{'exception': extype, 'args': value, 'traceback': "".join(tb)} )
return None
return None
def redirect_trailing_period_middleware(get_response):
def redirect_trailing_period(request):
response = get_response(request)
if response.status_code == 404 and request.path.endswith("."):
return HttpResponsePermanentRedirect(request.path.rstrip("."))
return response
if response.status_code == 404 and request.path.endswith("."):
return HttpResponsePermanentRedirect(request.path.rstrip("."))
return response
return redirect_trailing_period
def unicode_nfkc_normalization_middleware(get_response):

View file

@ -1127,7 +1127,7 @@ class InactiveNomcomTests(TestCase):
def test_acceptance_closed(self):
today = datetime.date.today().strftime('%Y%m%d')
pid = self.nc.position_set.first().nomineeposition_set.order_by('pk').first().id
pid = self.nc.position_set.first().nomineeposition_set.order_by('pk').first().id
url = reverse('ietf.nomcom.views.process_nomination_status', kwargs = {
'year' : self.nc.year(),
'nominee_position_id' : pid,

View file

@ -1,4 +1,4 @@
# Copyright The IETF Trust 2007, All Rights Reserved
# Copyright The IETF Trust 2007-2019, All Rights Reserved
from django.db import models
@ -22,7 +22,7 @@ class Redirect(models.Model):
rest = models.CharField(max_length=100, blank=True)
remove = models.CharField(max_length=50, blank=True)
def __str__(self):
return "%s -> %s/%s" % (self.cgi, self.url, self.rest)
return "%s -> %s/%s" % (self.cgi, self.url, self.rest)
class Suffix(models.Model):
"""This is a "rest" and "remove" (see Redirect class)
@ -31,7 +31,7 @@ class Suffix(models.Model):
rest = models.CharField(max_length=100, blank=True)
remove = models.CharField(max_length=50, blank=True)
def __str__(self):
return "-> %s - %s" % (self.rest, self.remove)
return "-> %s - %s" % (self.rest, self.remove)
class Meta:
verbose_name_plural="Suffixes"
@ -47,12 +47,12 @@ class Command(models.Model):
script = ForeignKey(Redirect, related_name='commands', editable=False)
suffix = ForeignKey(Suffix, null=True, blank=True)
def __str__(self):
ret = "%s?command=%s" % (self.script.cgi, self.command)
if self.suffix_id:
ret += " %s" % (self.suffix)
return ret
ret = "%s?command=%s" % (self.script.cgi, self.command)
if self.suffix_id:
ret += " %s" % (self.suffix)
return ret
class Meta:
unique_together = (("script", "command"), )
unique_together = (("script", "command"), )
# changes done by convert-096.py:changed maxlength to max_length
# removed core

View file

@ -10,7 +10,7 @@ from ietf.redirects.models import Redirect, Command
def redirect(request, path="", script=""):
if path:
script = path + "/" + script
script = path + "/" + script
redir = get_object_or_404(Redirect, cgi=script)
url = "/" + redir.url + "/"
(rest, remove) = (redir.rest, redir.remove)
@ -24,70 +24,70 @@ def redirect(request, path="", script=""):
else:
rparam = request.GET
for flag in redir.commands.all().filter(command__startswith='^'):
fc = flag.command[1:].split("^")
if len(fc) > 1:
if rparam.get('command') != fc[1]:
continue
if fc[0] in rparam:
remove_args.append(fc[0])
num = re.match('(\d+)', rparam[fc[0]])
if (num and int(num.group(1))) or (num is None):
cmd = flag
break
fc = flag.command[1:].split("^")
if len(fc) > 1:
if rparam.get('command') != fc[1]:
continue
if fc[0] in rparam:
remove_args.append(fc[0])
num = re.match('(\d+)', rparam[fc[0]])
if (num and int(num.group(1))) or (num is None):
cmd = flag
break
#
# If that search didn't result in a match, then look
# for an exact match for the command= parameter.
if cmd is None:
try:
cmd = redir.commands.all().get(command=rparam['command'])
except Command.DoesNotExist:
pass # it's ok, there's no more-specific request.
except KeyError:
pass # it's ok, request didn't have 'command'.
except:
pass # strange exception like the one described in
# http://merlot.tools.ietf.org/tools/ietfdb/ticket/179 ?
# just ignore the command string.
try:
cmd = redir.commands.all().get(command=rparam['command'])
except Command.DoesNotExist:
pass # it's ok, there's no more-specific request.
except KeyError:
pass # it's ok, request didn't have 'command'.
except:
pass # strange exception like the one described in
# http://merlot.tools.ietf.org/tools/ietfdb/ticket/179 ?
# just ignore the command string.
if cmd is not None:
remove_args.append('command')
if cmd.url:
rest = cmd.url + "/"
else:
rest = ""
if cmd.suffix:
rest = rest + cmd.suffix.rest
remove = cmd.suffix.remove
else:
remove = ""
remove_args.append('command')
if cmd.url:
rest = cmd.url + "/"
else:
rest = ""
if cmd.suffix:
rest = rest + cmd.suffix.rest
remove = cmd.suffix.remove
else:
remove = ""
try:
# This throws exception (which gets caught below) if request
# contains non-ASCII characters. The old scripts didn't support
# non-ASCII characters anyway, so there's no need to handle
# them fully correctly in these redirects.
url += str(rest % rparam)
url += "/"
url += str(rest % rparam)
url += "/"
except:
# rest had something in it that request didn't have, so just
# redirect to the root of the tool.
pass
# rest had something in it that request didn't have, so just
# redirect to the root of the tool.
pass
# Be generous in what you accept: collapse multiple slashes
url = re.sub(r'/+', '/', url)
if remove:
url = re.sub(re.escape(remove) + "/?$", "", url)
url = re.sub(re.escape(remove) + "/?$", "", url)
# If there is a dot in the last url segment, remove the
# trailing slash. This is basically the inverse of the
# APPEND_SLASH middleware.
if '/' in url and '.' in url.split('/')[-2]:
url = url.rstrip('/')
url = url.rstrip('/')
# Copy the GET arguments, remove all the ones we were
# expecting and if there are any left, add them to the URL.
get = request.GET.copy()
remove_args += re.findall(r'%\(([^)]+)\)', rest)
for arg in remove_args:
if arg in get:
get.pop(arg)
if arg in get:
get.pop(arg)
if get:
url += '?' + get.urlencode()
url += '?' + get.urlencode()
try:
return HttpResponsePermanentRedirect(url)
except BadHeaderError:

View file

@ -83,7 +83,7 @@ class UnavailablePeriodResource(ModelResource):
"start_date": ALL,
"end_date": ALL,
"availability": ALL,
"reason": ALL,
"reason": ALL,
"team": ALL_WITH_RELATIONS,
"person": ALL_WITH_RELATIONS,
}

View file

@ -1,3 +1,4 @@
# Copyright The IETF Trust 2013-2019, All Rights Reserved
from django.conf import settings
from ietf.person.models import Person
@ -32,8 +33,8 @@ def get_last_revision(filename):
"""
files = glob.glob(os.path.join(settings.INTERNET_DRAFT_ARCHIVE_DIR,filename) + '-??.txt')
if files:
sorted_files = sorted(files)
return get_revision(sorted_files[-1])
sorted_files = sorted(files)
return get_revision(sorted_files[-1])
else:
raise Exception('last revision not found in archive')

View file

@ -7,7 +7,7 @@
#
import os
from .settings import * # pyflakes:ignore
from ietf.settings import * # pyflakes:ignore
import debug # pyflakes:ignore
debug.debug = True

View file

@ -20,7 +20,7 @@ def show_submission_files(context, submission):
continue
result.append({'ext': '%s' % ext[1:],
'exists': exists,
'url': '%s%s-%s%s' % (settings.IDSUBMIT_STAGING_URL, submission.name, submission.rev, ext)})
'url': '%s%s-%s%s' % (settings.IDSUBMIT_STAGING_URL, submission.name, submission.rev, ext)})
return {'files': result}

View file

@ -3,10 +3,10 @@
# -*- python -*-
"""
NAME
%(program)s - Extract meta-information from an IETF draft.
%(program)s - Extract meta-information from an IETF draft.
SYNOPSIS
%(program)s [OPTIONS] DRAFTLIST_FILE
%(program)s [OPTIONS] DRAFTLIST_FILE
DESCRIPTION
Extract information about authors' names and email addresses,
@ -17,17 +17,17 @@ DESCRIPTION
%(options)s
AUTHOR
Written by Henrik Levkowetz, <henrik@levkowetz.com>
Written by Henrik Levkowetz, <henrik@levkowetz.com>
COPYRIGHT
Copyright 2008 Henrik Levkowetz
Copyright 2008 Henrik Levkowetz
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or (at
your option) any later version. There is NO WARRANTY; not even the
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the GNU General Public License for more details.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or (at
your option) any later version. There is NO WARRANTY; not even the
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the GNU General Public License for more details.
"""

View file

@ -50,11 +50,11 @@ def empty_outbox():
def add_headers(msg):
if not('Message-ID' in msg):
msg['Message-ID'] = make_msgid('idtracker')
msg['Message-ID'] = make_msgid('idtracker')
if not('Date' in msg):
msg['Date'] = formatdate(time.time(), True)
msg['Date'] = formatdate(time.time(), True)
if not('From' in msg):
msg['From'] = settings.DEFAULT_FROM_EMAIL
msg['From'] = settings.DEFAULT_FROM_EMAIL
return msg
class SMTPSomeRefusedRecipients(smtplib.SMTPException):
@ -145,11 +145,11 @@ def copy_email(msg, to, toUser=False, originalBcc=None):
# django settings if debugging?
# Should this be a template?
if settings.SERVER_MODE == 'production':
explanation = "This is a copy of a message sent from the I-D tracker."
explanation = "This is a copy of a message sent from the I-D tracker."
elif settings.SERVER_MODE == 'test' and toUser:
explanation = "The attached message was generated by an instance of the tracker\nin test mode. It is being sent to you because you, or someone acting\non your behalf, is testing the system. If you do not recognize\nthis action, please accept our apologies and do not be concerned as\nthe action is being taken in a test context."
explanation = "The attached message was generated by an instance of the tracker\nin test mode. It is being sent to you because you, or someone acting\non your behalf, is testing the system. If you do not recognize\nthis action, please accept our apologies and do not be concerned as\nthe action is being taken in a test context."
else:
explanation = "The attached message would have been sent, but the tracker is in %s mode.\nIt was not sent to anybody." % settings.SERVER_MODE
explanation = "The attached message would have been sent, but the tracker is in %s mode.\nIt was not sent to anybody." % settings.SERVER_MODE
if originalBcc:
explanation += ("\nIn addition to the destinations derived from the header below, the message would have been sent Bcc to %s" % originalBcc)
new.attach(MIMEText(explanation + "\n\n"))
@ -256,7 +256,7 @@ def condition_message(to, frm, subject, msg, cc, extra):
else:
extra['Reply-To'] = [frm, ]
frm = on_behalf_of(frm)
msg['From'] = frm
msg['From'] = frm
# The following is a hack to avoid an issue with how the email module (as of version 4.0.3)
# breaks lines when encoding header fields with anything other than the us-ascii codec.
@ -277,14 +277,14 @@ def condition_message(to, frm, subject, msg, cc, extra):
msg['To'] = to_str
if cc:
msg['Cc'] = cc
msg['Cc'] = cc
msg['Subject'] = subject
msg['X-Test-IDTracker'] = (settings.SERVER_MODE == 'production') and 'no' or 'yes'
msg['X-IETF-IDTracker'] = ietf.__version__
msg['Auto-Submitted'] = "auto-generated"
msg['Precedence'] = "bulk"
if extra:
for k, v in list(extra.items()):
for k, v in list(extra.items()):
if v:
assertion('len(list(set(v))) == len(v)')
try:
@ -330,12 +330,12 @@ def send_mail_mime(request, to, frm, subject, msg, cc=None, extra=None, toUser=F
show_that_mail_was_sent(request,'Email was sent',msg,bcc)
elif settings.SERVER_MODE == 'test':
if toUser:
copy_email(msg, to, toUser=True, originalBcc=bcc)
elif request and 'testmailcc' in request.COOKIES:
copy_email(msg, request.COOKIES[ 'testmailcc' ],originalBcc=bcc)
if toUser:
copy_email(msg, to, toUser=True, originalBcc=bcc)
elif request and 'testmailcc' in request.COOKIES:
copy_email(msg, request.COOKIES[ 'testmailcc' ],originalBcc=bcc)
try:
copy_to = settings.EMAIL_COPY_TO
copy_to = settings.EMAIL_COPY_TO
except AttributeError:
copy_to = "ietf.tracker.archive+%s@gmail.com" % settings.SERVER_MODE
if copy_to and (copy or not production) and not (test_mode or debugging): # if we're running automated tests, this copy is just annoying

View file

@ -26,12 +26,12 @@ WSGIPythonEggs /var/www/.python-eggs/
WSGIScriptAlias / /srv/www/ietfdb/ietf/wsgi.py
<Location "/accounts/login">
AuthType Digest
AuthName "IETF"
AuthUserFile /var/local/loginmgr/digest
AuthGroupFile /var/local/loginmgr/groups
AuthDigestDomain http://tools.ietf.org/
Require valid-user
AuthType Digest
AuthName "IETF"
AuthUserFile /var/local/loginmgr/digest
AuthGroupFile /var/local/loginmgr/groups
AuthDigestDomain http://tools.ietf.org/
Require valid-user
</Location>
</VirtualHost>
----