Merged in source:personal/henrik/r7446-pyflakes@7463, which adds pyflakes tests to the test suite, and makes the code pyflakes-clean.

- Legacy-Id: 7521
This commit is contained in:
Henrik Levkowetz 2014-03-19 18:48:33 +00:00
commit ff0dbe0d52
291 changed files with 1090 additions and 307741 deletions

View file

@ -1,3 +1,58 @@
ietfdb (5.2.0) ietf; urgency=low
This is a code cleanup release. It adds a test and a managemement command
to run pyflakes (pyflakes is a bit like 'lint' for Python) over the
datatracker code, and cleans up the code so that it tests clean. The number
of lines changed is large, but the changes to what the code actually does is
limited to fixing bugs discovered by pyflakes during the cleanup. There
were around 10 such cases.
Most of the changes are related to import statements, as the code otherwise
was pretty clean already. In almost all places, bulk imports using '*' has been
replaced by explicit imports, for these reasons:
* It makes it clear from where an imported name has come, so that a
human reader can look for an identifier in the import statements, and
see from where it comes, and where he should go to inspect the related
code.
* It makes it clear to the interpreter exactly which symbol is intended,
in cases where the same symbol is defined in multiple modules imported
using '*' import. This is not a common case, but it actually turned up
a couple of times during the cleanup. If the '*' imports in question
hadn't been turned into explicit imports, only the (somewhat arbitrary)
order of the import statements would have determine which instance of a
function or class would actually be visible to the following code. This
situation can make the code do something different from what was intended,
in a quite devious way.
* It avoids unintended import of generically named variables from other
modules. Altough having such variables as module globals is a bad
practice, it happens, and sometimes unintentionally importing them
through a '*' import will make it appear to the interpreter that a
statement intended to use an (by mistake undefined) identically named
local variable is in fact a valid statement which uses the imported
symbol instead. Without the '*' import, the situation would be
correctly flagged by the interpreter.
* Finally, importing all symbols explicitly makes it possible for pyflakes
to do a better job in identifying unused and undefined symbols -- in the
presence of '*' imports, this capability becomes much more limited.
Several cases of bad code (use of undefined variables) was discovered
during the cleanup only after the '*' imports were replaced by explicit
imports.
In many places, the import statements have been reordered to consistently
list the generic python library imports first, followed by django imports,
then local module imports (these typically live on the same level as ietf/
and django/), finally followed by datatracker-specific imports. Some people
find that this kind of consistency in importing, both in keeping a consistent
order, and in importing in a sequence from the more general down to the more
specific, aids in the readability of the code.
-- Henrik Levkowetz <henrik@levkowetz.com> 16 Mar 2014 20:52:05 +0100
ietfdb (5.1.1) ietf; urgency=medium ietfdb (5.1.1) ietf; urgency=medium
This is a minor bugfix release, in preparation for merging the pyflakes test This is a minor bugfix release, in preparation for merging the pyflakes test
@ -20,6 +75,7 @@ ietfdb (5.1.1) ietf; urgency=medium
-- Henrik Levkowetz <henrik@levkowetz.com> 18 Mar 2014 22:49:58 +0100 -- Henrik Levkowetz <henrik@levkowetz.com> 18 Mar 2014 22:49:58 +0100
ietfdb (5.1.0) ietf; urgency=high ietfdb (5.1.0) ietf; urgency=high
This release contains the datatracker bugfixes and enhancements from the This release contains the datatracker bugfixes and enhancements from the

View file

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

View file

@ -1,9 +1,8 @@
import datetime import datetime
from django.db.models import Q
from django.core.urlresolvers import reverse as urlreverse from django.core.urlresolvers import reverse as urlreverse
from ietf.doc.models import DocAlias, DocEvent from ietf.doc.models import DocAlias
class DisplayField(object): class DisplayField(object):

View file

@ -1,7 +1,6 @@
import sys import sys
from django.core.management.base import BaseCommand from django.core.management.base import BaseCommand
from django.db.models import Q
from ietf.community.constants import SIGNIFICANT_STATES from ietf.community.constants import SIGNIFICANT_STATES
from ietf.community.models import DocumentChangeDates from ietf.community.models import DocumentChangeDates

View file

@ -1,7 +1,7 @@
from south.db import db from south.db import db
from django.db import models from django.db import models
from ietf.community.models import * #from ietf.community.models import *
class Migration: class Migration:

View file

@ -1,7 +1,4 @@
from south.db import db from south.db import db
from django.db import models
from ietf.community.models import *
class Migration: class Migration:

View file

@ -1,7 +1,4 @@
from south.db import db from south.db import db
from django.db import models
from ietf.community.models import *
class Migration: class Migration:

View file

@ -1,7 +1,4 @@
from south.db import db from south.db import db
from django.db import models
from ietf.community.models import *
class Migration: class Migration:

View file

@ -1,7 +1,4 @@
from south.db import db from south.db import db
from django.db import models
from ietf.community.models import *
class Migration: class Migration:

View file

@ -1,7 +1,4 @@
from south.db import db from south.db import db
from django.db import models
from ietf.community.models import *
class Migration: class Migration:

View file

@ -1,8 +1,5 @@
# encoding: utf-8
import datetime
from south.db import db from south.db import db
from south.v2 import SchemaMigration from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration): class Migration(SchemaMigration):

View file

@ -1,5 +1,3 @@
from django.db.models import Q
from ietf.doc.models import Document from ietf.doc.models import Document
from ietf.group.models import Group from ietf.group.models import Group
from ietf.person.models import Person from ietf.person.models import Person

View file

@ -7,16 +7,15 @@ import json
from django.db import IntegrityError from django.db import IntegrityError
from django.conf import settings from django.conf import settings
from django.contrib.auth import REDIRECT_FIELD_NAME from django.contrib.auth import REDIRECT_FIELD_NAME
from django.contrib.auth.models import User
from django.http import HttpResponse, Http404, HttpResponseRedirect from django.http import HttpResponse, Http404, HttpResponseRedirect
from django.shortcuts import get_object_or_404, render_to_response from django.shortcuts import get_object_or_404, render_to_response
from django.template import RequestContext from django.template import RequestContext
from django.utils.http import urlquote from django.utils.http import urlquote
from ietf.community.models import CommunityList, Rule, EmailSubscription, ListNotification from ietf.community.models import CommunityList, Rule, EmailSubscription
from ietf.community.forms import RuleForm, DisplayForm, SubscribeForm, UnSubscribeForm from ietf.community.forms import RuleForm, DisplayForm, SubscribeForm, UnSubscribeForm
from ietf.group.models import Group from ietf.group.models import Group
from ietf.doc.models import Document, DocEvent, DocAlias from ietf.doc.models import DocEvent, DocAlias
def _manage_list(request, clist): def _manage_list(request, clist):

View file

@ -2,7 +2,6 @@
# coding: latin-1 # coding: latin-1
from types import ModuleType from types import ModuleType
import urls, views
# These people will be sent a stack trace if there's an uncaught exception in # These people will be sent a stack trace if there's an uncaught exception in
# code any of the modules imported above: # code any of the modules imported above:

View file

@ -1,7 +1,6 @@
# Copyright The IETF Trust 2010, All Rights Reserved # Copyright The IETF Trust 2010, All Rights Reserved
from django.http import HttpResponse from django.shortcuts import render_to_response as render
from django.shortcuts import render_to_response as render, get_object_or_404
from django.template import RequestContext from django.template import RequestContext
def settings(request, new_enough = -1, expires_soon = -1, full_draft = ""): def settings(request, new_enough = -1, expires_soon = -1, full_draft = ""):

View file

@ -5,7 +5,7 @@ from django.template import Context
from ietf.dbtemplate.models import DBTemplate from ietf.dbtemplate.models import DBTemplate
from ietf.dbtemplate.template import PlainTemplate, RSTTemplate, DjangoTemplate from ietf.dbtemplate.template import PlainTemplate, RSTTemplate, DjangoTemplate
import debug import debug # pyflakes:ignore
class DBTemplateForm(forms.ModelForm): class DBTemplateForm(forms.ModelForm):
@ -13,7 +13,7 @@ class DBTemplateForm(forms.ModelForm):
try: try:
content = self.cleaned_data['content'] content = self.cleaned_data['content']
if self.instance.type.slug == 'rst': if self.instance.type.slug == 'rst':
return_code = RSTTemplate(content).render(Context({})) RSTTemplate(content).render(Context({}))
elif self.instance.type.slug == 'django': elif self.instance.type.slug == 'django':
DjangoTemplate(content).render(Context({})) DjangoTemplate(content).render(Context({}))
elif self.instance.type.slug == 'plain': elif self.instance.type.slug == 'plain':

View file

@ -1,8 +1,6 @@
# encoding: utf-8 # encoding: utf-8
import datetime
from south.db import db from south.db import db
from south.v2 import SchemaMigration from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration): class Migration(SchemaMigration):

View file

@ -2,7 +2,7 @@ import os
import string import string
from docutils.core import publish_string from docutils.core import publish_string
from docutils.utils import SystemMessage from docutils.utils import SystemMessage
import debug import debug # pyflakes:ignore
from django.template import Template as DjangoTemplate, TemplateDoesNotExist, TemplateEncodingError from django.template import Template as DjangoTemplate, TemplateDoesNotExist, TemplateEncodingError
from django.template.loader import BaseLoader from django.template.loader import BaseLoader

View file

@ -3,10 +3,8 @@ from django.utils.safestring import mark_safe
from django.contrib import admin from django.contrib import admin
from django import forms from django import forms
from models import * from models import * # pyflakes:ignore
from ietf.person.models import *
from ietf.doc.utils import get_state_types from ietf.doc.utils import get_state_types
from ietf.utils.admin import admin_link
class StateTypeAdmin(admin.ModelAdmin): class StateTypeAdmin(admin.ModelAdmin):
list_display = ["slug", "label"] list_display = ["slug", "label"]

View file

@ -1,12 +1,10 @@
# expiry of Internet Drafts # expiry of Internet Drafts
from django.conf import settings from django.conf import settings
from django.template.loader import render_to_string
from django.db.models import Q
import datetime, os, shutil, glob, re import datetime, os, shutil, glob, re
from ietf.utils.mail import send_mail, send_mail_subj from ietf.utils.mail import send_mail
from ietf.doc.models import Document, DocEvent, State, save_document_in_history, IESG_SUBSTATE_TAGS from ietf.doc.models import Document, DocEvent, State, save_document_in_history, IESG_SUBSTATE_TAGS
from ietf.person.models import Person, Email from ietf.person.models import Person, Email
from ietf.meeting.models import Meeting from ietf.meeting.models import Meeting
@ -149,7 +147,6 @@ def clean_up_draft_files():
cut_off = datetime.date.today() cut_off = datetime.date.today()
pattern = os.path.join(settings.INTERNET_DRAFT_PATH, "draft-*.*") pattern = os.path.join(settings.INTERNET_DRAFT_PATH, "draft-*.*")
files = []
filename_re = re.compile('^(.*)-(\d\d)$') filename_re = re.compile('^(.*)-(\d\d)$')
def splitext(fn): def splitext(fn):

View file

@ -1,15 +1,12 @@
# Copyright The IETF Trust 2007, All Rights Reserved # Copyright The IETF Trust 2007, All Rights Reserved
import datetime, re
from django.conf import settings
from django.contrib.syndication.views import Feed, FeedDoesNotExist from django.contrib.syndication.views import Feed, FeedDoesNotExist
from django.utils.feedgenerator import Atom1Feed from django.utils.feedgenerator import Atom1Feed
from django.core.urlresolvers import reverse as urlreverse from django.core.urlresolvers import reverse as urlreverse
from django.template.defaultfilters import truncatewords, truncatewords_html, date as datefilter, linebreaks from django.template.defaultfilters import truncatewords, truncatewords_html, date as datefilter, linebreaks
from django.utils.html import strip_tags from django.utils.html import strip_tags
from ietf.doc.models import * from ietf.doc.models import Document, State, LastCallDocEvent
from ietf.doc.utils import augment_events_with_revision from ietf.doc.utils import augment_events_with_revision
from ietf.doc.templatetags.ietf_filters import format_textarea from ietf.doc.templatetags.ietf_filters import format_textarea

View file

@ -2,12 +2,15 @@
import datetime import datetime
from django.conf import settings from django.db.models import Q
from ietf.doc.models import * from ietf.doc.models import Document, State, DocEvent, LastCallDocEvent, WriteupDocEvent
from ietf.doc.models import save_document_in_history
from ietf.doc.models import IESG_SUBSTATE_TAGS
from ietf.person.models import Person from ietf.person.models import Person
from ietf.doc.utils import add_state_change_event from ietf.doc.utils import add_state_change_event
from ietf.doc.mails import * from ietf.doc.mails import generate_ballot_writeup, generate_approval_mail, generate_last_call_announcement
from ietf.doc.mails import send_last_call_request, email_last_call_expired
def request_last_call(request, doc): def request_last_call(request, doc):
if not doc.latest_event(type="changed_ballot_writeup_text"): if not doc.latest_event(type="changed_ballot_writeup_text"):

View file

@ -13,7 +13,6 @@ from ietf.doc.models import WriteupDocEvent, BallotPositionDocEvent, LastCallDoc
from ietf.doc.utils import needed_ballot_positions from ietf.doc.utils import needed_ballot_positions
from ietf.person.models import Person from ietf.person.models import Person
from ietf.group.models import Group, Role from ietf.group.models import Group, Role
from ietf.doc.utils import needed_ballot_positions
def email_state_changed(request, doc, text): def email_state_changed(request, doc, text):
to = [x.strip() for x in doc.notify.replace(';', ',').split(',')] to = [x.strip() for x in doc.notify.replace(';', ',').split(',')]

View file

@ -2,7 +2,6 @@ import sys
import os import os
from django.core.management.base import BaseCommand from django.core.management.base import BaseCommand
from django.db.models import Q
from django.conf import settings from django.conf import settings
from django.template.loader import render_to_string from django.template.loader import render_to_string

View file

@ -1,5 +1,4 @@
# encoding: utf-8 # encoding: utf-8
import datetime
from south.db import db from south.db import db
from south.v2 import SchemaMigration from south.v2 import SchemaMigration
from django.db import models from django.db import models

View file

@ -1,11 +1,6 @@
# encoding: utf-8 # encoding: utf-8
import datetime
from south.db import db
from south.v2 import DataMigration from south.v2 import DataMigration
from django.db import models
from doc.models import StateType, State, BallotType, DocTypeName from doc.models import StateType, State, BallotType, DocTypeName
from name.models import BallotPositionName
class Migration(DataMigration): class Migration(DataMigration):

View file

@ -1,8 +1,5 @@
# encoding: utf-8 # encoding: utf-8
import datetime
from south.db import db
from south.v2 import DataMigration from south.v2 import DataMigration
from django.db import models
from person.models import Person from person.models import Person
from doc.models import BallotPositionDocEvent from doc.models import BallotPositionDocEvent

View file

@ -1,8 +1,6 @@
# encoding: utf-8 # encoding: utf-8
import datetime
from south.db import db from south.db import db
from south.v2 import SchemaMigration from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration): class Migration(SchemaMigration):

View file

@ -1,8 +1,5 @@
# encoding: utf-8 # encoding: utf-8
import datetime
from south.db import db
from south.v2 import DataMigration from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration): class Migration(DataMigration):

View file

@ -1,8 +1,5 @@
# encoding: utf-8 # encoding: utf-8
import datetime
from south.db import db
from south.v2 import DataMigration from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration): class Migration(DataMigration):

View file

@ -2,7 +2,6 @@
import datetime import datetime
from south.db import db from south.db import db
from south.v2 import SchemaMigration from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration): class Migration(SchemaMigration):

View file

@ -1,11 +1,7 @@
# encoding: utf-8 # encoding: utf-8
import datetime
from south.db import db
from south.v2 import DataMigration from south.v2 import DataMigration
from django.db import models
from ietf.doc.models import StateType, State, BallotType, DocTypeName from ietf.doc.models import StateType, State, BallotType, DocTypeName
from ietf.name.models import BallotPositionName
class Migration(DataMigration): class Migration(DataMigration):

View file

@ -1,8 +1,5 @@
# encoding: utf-8 # encoding: utf-8
import datetime
from south.db import db
from south.v2 import DataMigration from south.v2 import DataMigration
from django.db import models
from ietf.doc.models import State,StateType from ietf.doc.models import State,StateType

View file

@ -1,8 +1,5 @@
# encoding: utf-8 # encoding: utf-8
import datetime
from south.db import db
from south.v2 import DataMigration from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration): class Migration(DataMigration):

View file

@ -1,8 +1,6 @@
# encoding: utf-8 # encoding: utf-8
import datetime, re import re
from south.db import db
from south.v2 import DataMigration from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration): class Migration(DataMigration):

View file

@ -1,8 +1,5 @@
# encoding: utf-8 # encoding: utf-8
import datetime
from south.db import db
from south.v2 import DataMigration from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration): class Migration(DataMigration):

View file

@ -1,6 +1,4 @@
# encoding: utf-8 # encoding: utf-8
import datetime
from south.db import db
from south.v2 import DataMigration from south.v2 import DataMigration
from django.db import models from django.db import models

View file

@ -1,8 +1,5 @@
# encoding: utf-8 # encoding: utf-8
import datetime
from south.db import db
from south.v2 import DataMigration from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration): class Migration(DataMigration):

View file

@ -1,8 +1,6 @@
# encoding: utf-8 # encoding: utf-8
import datetime
from south.db import db from south.db import db
from south.v2 import SchemaMigration from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration): class Migration(SchemaMigration):

View file

@ -1,6 +1,4 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import DataMigration from south.v2 import DataMigration
from django.db import models from django.db import models

View file

@ -1,9 +1,5 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import DataMigration from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration): class Migration(DataMigration):
@ -26,7 +22,7 @@ class Migration(DataMigration):
# Can't reliably determine what the old states might have been, so just capture what the state was set to # Can't reliably determine what the old states might have been, so just capture what the state was set to
for event in orm.DocEvent.objects.filter(type='changed_document',desc="IESG state set to Publication Requested"): for event in orm.DocEvent.objects.filter(type='changed_document',desc="IESG state set to Publication Requested"):
for new_state in missing_states : for new_state in missing_states :
e = self.add_state_change_event(orm=orm,doc=event.doc,by=event.by,new_state=new_state,timestamp=event.time) self.add_state_change_event(orm=orm,doc=event.doc,by=event.by,new_state=new_state,timestamp=event.time)
def backwards(self, orm): def backwards(self, orm):
"Write your backwards methods here." "Write your backwards methods here."

View file

@ -1,18 +1,21 @@
# Copyright The IETF Trust 2007, All Rights Reserved # Copyright The IETF Trust 2007, All Rights Reserved
import datetime, os
from django.db import models from django.db import models
from django.core.urlresolvers import reverse as urlreverse from django.core.urlresolvers import reverse as urlreverse
from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes.models import ContentType
from django.conf import settings from django.conf import settings
from django.utils.html import mark_safe from django.utils.html import mark_safe
from ietf.group.models import * import debug # pyflakes:ignore
from ietf.name.models import *
from ietf.group.models import Group
from ietf.name.models import ( DocTypeName, DocTagName, StreamName, IntendedStdLevelName, StdLevelName,
DocRelationshipName, DocReminderTypeName, BallotPositionName )
from ietf.person.models import Email, Person from ietf.person.models import Email, Person
from ietf.utils.admin import admin_link from ietf.utils.admin import admin_link
import datetime, os
import debug
class StateType(models.Model): class StateType(models.Model):
slug = models.CharField(primary_key=True, max_length=30) # draft, draft-iesg, charter, ... slug = models.CharField(primary_key=True, max_length=30) # draft, draft-iesg, charter, ...
@ -164,8 +167,6 @@ class RelatedDocument(models.Model):
relationship = models.ForeignKey(DocRelationshipName) relationship = models.ForeignKey(DocRelationshipName)
def action(self): def action(self):
return self.relationship.name return self.relationship.name
def inverse_action():
return self.relationship.revname
def __unicode__(self): def __unicode__(self):
return u"%s %s %s" % (self.source.name, self.relationship.name.lower(), self.target.name) return u"%s %s %s" % (self.source.name, self.relationship.name.lower(), self.target.name)

View file

@ -1,4 +1,4 @@
from django.conf.urls import patterns, url from django.conf.urls import patterns
from django.views.generic import RedirectView from django.views.generic import RedirectView
urlpatterns = patterns('', urlpatterns = patterns('',

View file

@ -34,12 +34,11 @@ import datetime
from django import template from django import template
from django.core.urlresolvers import reverse as urlreverse from django.core.urlresolvers import reverse as urlreverse
from django.conf import settings
from django.db.models import Q from django.db.models import Q
from django.utils.safestring import mark_safe from django.utils.safestring import mark_safe
from ietf.ietfauth.utils import user_is_person, has_role from ietf.ietfauth.utils import user_is_person, has_role
from ietf.doc.models import BallotDocEvent, BallotPositionDocEvent, IESG_BALLOT_ACTIVE_STATES, IESG_SUBSTATE_TAGS from ietf.doc.models import BallotPositionDocEvent, IESG_BALLOT_ACTIVE_STATES
from ietf.name.models import BallotPositionName from ietf.name.models import BallotPositionName

View file

@ -7,14 +7,11 @@ import types
from email.utils import parseaddr from email.utils import parseaddr
from django import template from django import template
from django.conf import settings
from django.utils.html import escape, fix_ampersands from django.utils.html import escape, fix_ampersands
from django.template.defaultfilters import truncatewords_html, linebreaksbr, wordwrap, stringfilter, urlize from django.template.defaultfilters import truncatewords_html, linebreaksbr, stringfilter, urlize
from django.template import resolve_variable from django.template import resolve_variable
from django.utils.safestring import mark_safe, SafeData from django.utils.safestring import mark_safe, SafeData
from django.utils.html import strip_tags from django.utils.html import strip_tags
from django.template import RequestContext
register = template.Library() register = template.Library()
@ -323,6 +320,7 @@ def wrap_text(text, width=72):
lines = text.split("\n") lines = text.split("\n")
filled = [] filled = []
wrapped = False wrapped = False
prev_indent = None
for line in lines: for line in lines:
line = line.expandtabs() line = line.expandtabs()
indent = " " * (len(line) - len(line.lstrip())) indent = " " * (len(line) - len(line.lstrip()))

View file

@ -1,6 +1,4 @@
from django import template from django import template
from django.core.cache import cache
from django.template import loader
register = template.Library() register = template.Library()

View file

@ -1,6 +1,4 @@
from django import template from django import template
from django.conf import settings
from django.core.urlresolvers import reverse as urlreverse
from django.contrib.auth.models import AnonymousUser from django.contrib.auth.models import AnonymousUser
from ietf.ietfauth.utils import has_role from ietf.ietfauth.utils import has_role

View file

@ -1,25 +1,21 @@
import os, shutil, datetime import datetime
import sys import sys
if sys.version_info[0] == 2 and sys.version_info[1] < 7: if sys.version_info[0] == 2 and sys.version_info[1] < 7:
import unittest2 as unittest import unittest2 as unittest
else: else:
import unittest import unittest
from pyquery import PyQuery
from django.core.urlresolvers import reverse as urlreverse from django.core.urlresolvers import reverse as urlreverse
from pyquery import PyQuery from ietf.doc.models import ( Document, DocAlias, DocRelationshipName, RelatedDocument, State,
DocEvent, BallotPositionDocEvent, LastCallDocEvent, WriteupDocEvent )
from ietf.group.models import Group
from ietf.person.models import Person
from ietf.utils.mail import outbox from ietf.utils.mail import outbox
from ietf.utils.test_utils import login_testing_unauthorized
from ietf.utils.test_data import make_test_data from ietf.utils.test_data import make_test_data
from ietf.utils import TestCase from ietf.utils.test_utils import login_testing_unauthorized
from ietf.utils.test_utils import TestCase
from ietf.doc.models import *
from ietf.name.models import *
from ietf.group.models import *
from ietf.person.models import *
from ietf.meeting.models import Meeting, MeetingTypeName
from ietf.iesg.models import TelechatDate
class SearchTestCase(TestCase): class SearchTestCase(TestCase):
def test_search(self): def test_search(self):
@ -98,7 +94,7 @@ class SearchTestCase(TestCase):
self.assertTrue(draft.title in r.content) self.assertTrue(draft.title in r.content)
def test_frontpage(self): def test_frontpage(self):
draft = make_test_data() make_test_data()
r = self.client.get("/") r = self.client.get("/")
self.assertEqual(r.status_code, 200) self.assertEqual(r.status_code, 200)
self.assertTrue("Search Internet-Drafts" in r.content) self.assertTrue("Search Internet-Drafts" in r.content)
@ -309,7 +305,7 @@ class DocTestCase(TestCase):
doc.set_state(State.objects.get(type="draft-iesg", slug="lc")) doc.set_state(State.objects.get(type="draft-iesg", slug="lc"))
e = LastCallDocEvent.objects.create( LastCallDocEvent.objects.create(
doc=doc, doc=doc,
desc="Last call", desc="Last call",
type="sent_last_call", type="sent_last_call",

View file

@ -1,24 +1,20 @@
import unittest import datetime
import StringIO from pyquery import PyQuery
import os, shutil
from datetime import date, timedelta, time import debug # pyflakes:ignore
from django.core.urlresolvers import reverse as urlreverse from django.core.urlresolvers import reverse as urlreverse
from django.conf import settings
from pyquery import PyQuery from ietf.doc.models import ( Document, State, DocEvent, BallotDocEvent,
import debug BallotPositionDocEvent, LastCallDocEvent, WriteupDocEvent )
from ietf.group.models import Group, Role
from ietf.doc.models import * from ietf.name.models import BallotPositionName
from ietf.name.models import * from ietf.person.models import Person
from ietf.group.models import * from ietf.utils.test_utils import TestCase
from ietf.person.models import *
from ietf.meeting.models import Meeting, MeetingTypeName
from ietf.iesg.models import TelechatDate
from ietf.utils.test_utils import login_testing_unauthorized
from ietf.utils.test_data import make_test_data
from ietf.utils.mail import outbox from ietf.utils.mail import outbox
from ietf.utils import TestCase from ietf.utils.test_data import make_test_data
from ietf.utils.test_utils import login_testing_unauthorized
class EditPositionTests(TestCase): class EditPositionTests(TestCase):
def test_edit_position(self): def test_edit_position(self):
@ -98,7 +94,7 @@ class EditPositionTests(TestCase):
self.assertTrue(len(q('form input[name=position]')) > 0) self.assertTrue(len(q('form input[name=position]')) > 0)
# vote on behalf of AD # vote on behalf of AD
events_before = draft.docevent_set.count() # events_before = draft.docevent_set.count()
r = self.client.post(url, dict(position="discuss", discuss="Test discuss text")) r = self.client.post(url, dict(position="discuss", discuss="Test discuss text"))
self.assertEqual(r.status_code, 302) self.assertEqual(r.status_code, 302)

View file

@ -2,24 +2,21 @@
import os, shutil, datetime import os, shutil, datetime
from StringIO import StringIO from StringIO import StringIO
from pyquery import PyQuery
from django.conf import settings from django.conf import settings
from django.core.urlresolvers import reverse as urlreverse from django.core.urlresolvers import reverse as urlreverse
from ietf.doc.models import ( Document, State, BallotDocEvent, BallotType, NewRevisionDocEvent,
TelechatDocEvent, WriteupDocEvent )
from ietf.doc.utils_charter import next_revision, default_review_text, default_action_text
from ietf.group.models import Group, GroupMilestone
from ietf.iesg.models import TelechatDate
from ietf.person.models import Person
from ietf.utils.test_utils import TestCase
from ietf.utils.mail import outbox from ietf.utils.mail import outbox
from ietf.utils.test_data import make_test_data from ietf.utils.test_data import make_test_data
from ietf.utils.test_utils import login_testing_unauthorized from ietf.utils.test_utils import login_testing_unauthorized
from ietf.utils import TestCase
from pyquery import PyQuery
from ietf.doc.models import *
from ietf.doc.utils import *
from ietf.group.models import *
from ietf.group.utils import *
from ietf.name.models import *
from ietf.person.models import *
from ietf.iesg.models import TelechatDate
from ietf.doc.utils_charter import *
class EditCharterTests(TestCase): class EditCharterTests(TestCase):
def setUp(self): def setUp(self):
@ -332,12 +329,14 @@ class EditCharterTests(TestCase):
desc="Has been copied", desc="Has been copied",
due=due_date, due=due_date,
resolved="") resolved="")
m2 = GroupMilestone.objects.create(group=group, # m2 isn't used -- missing test?
m2 = GroupMilestone.objects.create(group=group, # pyflakes:ignore
state_id="active", state_id="active",
desc="To be deleted", desc="To be deleted",
due=due_date, due=due_date,
resolved="") resolved="")
m3 = GroupMilestone.objects.create(group=group, # m3 isn't used -- missing test?
m3 = GroupMilestone.objects.create(group=group, # pyflakes:ignore
state_id="charter", state_id="charter",
desc="Has been copied", desc="Has been copied",
due=due_date, due=due_date,

View file

@ -5,21 +5,19 @@ from pyquery import PyQuery
from StringIO import StringIO from StringIO import StringIO
from textwrap import wrap from textwrap import wrap
from django.conf import settings from django.conf import settings
from django.core.urlresolvers import reverse as urlreverse from django.core.urlresolvers import reverse as urlreverse
from ietf.utils.test_utils import login_testing_unauthorized from ietf.doc.models import Document, DocEvent, NewRevisionDocEvent, BallotPositionDocEvent, TelechatDocEvent, State
from ietf.utils.test_data import make_test_data
from ietf.utils.mail import outbox
from ietf.doc.utils import create_ballot_if_not_open from ietf.doc.utils import create_ballot_if_not_open
from ietf.doc.views_conflict_review import default_approval_text from ietf.doc.views_conflict_review import default_approval_text
from ietf.utils import TestCase
from ietf.doc.models import Document,DocEvent,NewRevisionDocEvent,BallotPositionDocEvent,TelechatDocEvent,DocAlias,State
from ietf.name.models import StreamName
from ietf.group.models import Person from ietf.group.models import Person
from ietf.iesg.models import TelechatDate from ietf.iesg.models import TelechatDate
from ietf.name.models import StreamName
from ietf.utils.test_utils import TestCase
from ietf.utils.mail import outbox
from ietf.utils.test_data import make_test_data
from ietf.utils.test_utils import login_testing_unauthorized
class ConflictReviewTests(TestCase): class ConflictReviewTests(TestCase):

View file

@ -1,23 +1,26 @@
import os
import shutil
import datetime
import StringIO import StringIO
import os, shutil, datetime from pyquery import PyQuery
from django.core.urlresolvers import reverse as urlreverse from django.core.urlresolvers import reverse as urlreverse
from django.conf import settings from django.conf import settings
from pyquery import PyQuery import debug # pyflakes:ignore
import debug
from ietf.doc.models import * from ietf.doc.models import ( Document, DocAlias, DocReminder, DocumentAuthor, DocEvent,
from ietf.doc.utils import * ConsensusDocEvent, LastCallDocEvent, RelatedDocument, State, TelechatDocEvent, WriteupDocEvent )
from ietf.name.models import * from ietf.doc.utils import get_tags_for_stream_id
from ietf.group.models import * from ietf.name.models import StreamName, IntendedStdLevelName, DocTagName
from ietf.person.models import * from ietf.group.models import Group
from ietf.person.models import Person, Email
from ietf.meeting.models import Meeting, MeetingTypeName from ietf.meeting.models import Meeting, MeetingTypeName
from ietf.iesg.models import TelechatDate from ietf.iesg.models import TelechatDate
from ietf.utils.test_utils import login_testing_unauthorized from ietf.utils.test_utils import login_testing_unauthorized
from ietf.utils.test_data import make_test_data from ietf.utils.test_data import make_test_data
from ietf.utils.mail import outbox from ietf.utils.mail import outbox
from ietf.utils import TestCase from ietf.utils.test_utils import TestCase
class ChangeStateTests(TestCase): class ChangeStateTests(TestCase):
@ -280,7 +283,7 @@ class EditInfoTests(TestCase):
ad=None, ad=None,
expires=datetime.datetime.now() + datetime.timedelta(days=settings.INTERNET_DRAFT_DAYS_TO_EXPIRE), expires=datetime.datetime.now() + datetime.timedelta(days=settings.INTERNET_DRAFT_DAYS_TO_EXPIRE),
) )
doc_alias = DocAlias.objects.create( DocAlias.objects.create(
document=draft, document=draft,
name=draft.name, name=draft.name,
) )
@ -854,7 +857,6 @@ class IndividualInfoFormsTests(TestCase):
test_file.name = "unnamed" test_file.name = "unnamed"
r = self.client.post(url,dict(txt=test_file,submit_response="1")) r = self.client.post(url,dict(txt=test_file,submit_response="1"))
self.assertEqual(r.status_code, 302) self.assertEqual(r.status_code, 302)
doc = Document.objects.get(name=self.docname)
self.assertTrue(self.doc.latest_event(WriteupDocEvent,type="changed_protocol_writeup").text.startswith('This is a different writeup.')) self.assertTrue(self.doc.latest_event(WriteupDocEvent,type="changed_protocol_writeup").text.startswith('This is a different writeup.'))
# template reset # template reset

View file

@ -5,21 +5,19 @@ from pyquery import PyQuery
from StringIO import StringIO from StringIO import StringIO
from textwrap import wrap from textwrap import wrap
from django.conf import settings from django.conf import settings
from django.core.urlresolvers import reverse as urlreverse from django.core.urlresolvers import reverse as urlreverse
from ietf.utils.test_utils import login_testing_unauthorized from ietf.doc.models import ( Document, DocAlias, State, DocEvent,
from ietf.utils.test_data import make_test_data BallotPositionDocEvent, NewRevisionDocEvent, TelechatDocEvent, WriteupDocEvent )
from ietf.utils.mail import outbox
from ietf.doc.utils import create_ballot_if_not_open from ietf.doc.utils import create_ballot_if_not_open
from ietf.doc.views_status_change import default_approval_text from ietf.doc.views_status_change import default_approval_text
from ietf.utils import TestCase
from ietf.doc.models import Document,DocEvent,NewRevisionDocEvent,BallotPositionDocEvent,TelechatDocEvent,WriteupDocEvent,DocAlias,State
from ietf.name.models import StreamName
from ietf.group.models import Person from ietf.group.models import Person
from ietf.iesg.models import TelechatDate from ietf.iesg.models import TelechatDate
from ietf.utils.test_utils import TestCase
from ietf.utils.mail import outbox
from ietf.utils.test_data import make_test_data
from ietf.utils.test_utils import login_testing_unauthorized
class StatusChangeTests(TestCase): class StatusChangeTests(TestCase):

View file

@ -33,7 +33,6 @@
from django.conf.urls import patterns, url, include from django.conf.urls import patterns, url, include
from django.views.generic import RedirectView from django.views.generic import RedirectView
from ietf.doc.models import State
from ietf.doc import views_search, views_draft, views_ballot from ietf.doc import views_search, views_draft, views_ballot
from ietf.doc import views_status_change from ietf.doc import views_status_change
from ietf.doc import views_doc from ietf.doc import views_doc

View file

@ -1,13 +1,17 @@
import os, re, urllib import os
import re
import urllib
import math import math
from django.conf import settings from django.conf import settings
from ietf.utils import markup_txt from ietf.utils import markup_txt
from ietf.doc.models import * from ietf.doc.models import DocAlias, RelatedDocument, BallotType, DocReminder
from ietf.doc.models import DocEvent, BallotDocEvent, NewRevisionDocEvent, StateDocEvent
from ietf.name.models import DocReminderTypeName, DocRelationshipName
from ietf.group.models import Role from ietf.group.models import Role
from ietf.ietfauth.utils import has_role from ietf.ietfauth.utils import has_role
from ietf.person.models import Person
from ietf.utils import draft from ietf.utils import draft
def get_state_types(doc): def get_state_types(doc):

View file

@ -1,16 +1,13 @@
import re, datetime, os, textwrap import re, datetime, os
from django.template.loader import render_to_string from django.template.loader import render_to_string
from django.utils.html import strip_tags from django.utils.html import strip_tags
from django.conf import settings from django.conf import settings
from django.core.urlresolvers import reverse as urlreverse
from ietf.utils.mail import send_mail_text from ietf.doc.models import NewRevisionDocEvent, WriteupDocEvent, BallotPositionDocEvent
from ietf.person.models import Person from ietf.person.models import Person
from ietf.group.models import GroupEvent, ChangeStateGroupEvent
from ietf.doc.models import Document, DocAlias, DocHistory, RelatedDocument, DocumentAuthor
from ietf.doc.models import DocEvent, NewRevisionDocEvent, WriteupDocEvent, BallotPositionDocEvent
from ietf.utils.history import find_history_active_at from ietf.utils.history import find_history_active_at
from ietf.utils.mail import send_mail_text
def next_revision(rev): def next_revision(rev):

View file

@ -1,33 +1,32 @@
# ballot management (voting, commenting, writeups, ...) for Area # ballot management (voting, commenting, writeups, ...) for Area
# Directors and Secretariat # Directors and Secretariat
import re, os, datetime, json import datetime, json
from django.http import HttpResponse, HttpResponseForbidden, HttpResponseRedirect, Http404 from django.http import HttpResponseForbidden, HttpResponseRedirect, Http404
from django.shortcuts import render_to_response, get_object_or_404, redirect from django.shortcuts import render_to_response, get_object_or_404, redirect
from django.core.urlresolvers import reverse as urlreverse from django.core.urlresolvers import reverse as urlreverse
from django.template.loader import render_to_string from django.template.loader import render_to_string
from django.template import RequestContext from django.template import RequestContext
from django import forms from django import forms
from django.utils.html import strip_tags
from django.conf import settings from django.conf import settings
import debug import debug # pyflakes:ignore
from ietf.utils.mail import send_mail_text, send_mail_preformatted from ietf.doc.models import ( Document, State, DocEvent, BallotDocEvent, BallotPositionDocEvent,
from ietf.ietfauth.utils import has_role, role_required BallotType, LastCallDocEvent, WriteupDocEvent, save_document_in_history, IESG_SUBSTATE_TAGS )
from ietf.iesg.models import TelechatDate from ietf.doc.utils import ( add_state_change_event, close_ballot, close_open_ballots,
from ietf.ipr.models import IprDetail create_ballot_if_not_open, update_telechat )
from ietf.ipr.search import iprs_from_docs from ietf.doc.mails import ( email_ad, email_ballot_deferred, email_state_changed,
from ietf.doc.mails import * extra_automation_headers, generate_last_call_announcement, generate_issue_ballot_mail,
generate_ballot_writeup, generate_approval_mail )
from ietf.doc.lastcall import request_last_call from ietf.doc.lastcall import request_last_call
from ietf.iesg.models import TelechatDate
from ietf.doc.utils import * from ietf.ietfauth.utils import has_role, role_required
from ietf.doc.models import *
from ietf.name.models import BallotPositionName
from ietf.message.utils import infer_message from ietf.message.utils import infer_message
from ietf.name.models import BallotPositionName
from ietf.person.models import Person from ietf.person.models import Person
from ietf.utils.mail import send_mail_text, send_mail_preformatted
BALLOT_CHOICES = (("yes", "Yes"), BALLOT_CHOICES = (("yes", "Yes"),
("noobj", "No Objection"), ("noobj", "No Objection"),
@ -80,18 +79,6 @@ def position_to_ballot_choice(position):
def position_label(position_value): def position_label(position_value):
return dict(BALLOT_CHOICES).get(position_value, "") return dict(BALLOT_CHOICES).get(position_value, "")
def get_ballot_info(ballot, area_director):
pos = Position.objects.filter(ballot=ballot, ad=area_director)
pos = pos[0] if pos else None
discuss = IESGDiscuss.objects.filter(ballot=ballot, ad=area_director)
discuss = discuss[0] if discuss else None
comment = IESGComment.objects.filter(ballot=ballot, ad=area_director)
comment = comment[0] if comment else None
return (pos, discuss, comment)
# ------------------------------------------------- # -------------------------------------------------
class EditPositionForm(forms.Form): class EditPositionForm(forms.Form):
position = forms.ModelChoiceField(queryset=BallotPositionName.objects.all(), widget=forms.RadioSelect, initial="norecord", required=True) position = forms.ModelChoiceField(queryset=BallotPositionName.objects.all(), widget=forms.RadioSelect, initial="norecord", required=True)
@ -253,7 +240,7 @@ def send_ballot_comment(request, name, ballot_id):
doc = get_object_or_404(Document, docalias__name=name) doc = get_object_or_404(Document, docalias__name=name)
ballot = get_object_or_404(BallotDocEvent, type="created_ballot", pk=ballot_id, doc=doc) ballot = get_object_or_404(BallotDocEvent, type="created_ballot", pk=ballot_id, doc=doc)
ad = login = request.user.person ad = request.user.person
return_to_url = request.GET.get('return_to_url') return_to_url = request.GET.get('return_to_url')
if not return_to_url: if not return_to_url:
@ -485,7 +472,6 @@ def lastcalltext(request, name):
s = doc.get_state("draft-iesg") s = doc.get_state("draft-iesg")
can_request_last_call = s.order < 27 can_request_last_call = s.order < 27
can_make_last_call = s.order < 20 can_make_last_call = s.order < 20
can_announce = s.order > 19
need_intended_status = "" need_intended_status = ""
if not doc.intended_std_level: if not doc.intended_std_level:

View file

@ -1,32 +1,36 @@
import re, os, string, datetime, shutil, textwrap, json import os, datetime, shutil, textwrap, json
from django.http import HttpResponse, HttpResponseRedirect, HttpResponseNotFound, Http404 from django.http import HttpResponse, HttpResponseRedirect, HttpResponseNotFound, Http404
from django.shortcuts import render_to_response, get_object_or_404, redirect from django.shortcuts import render_to_response, get_object_or_404, redirect
from django.template.loader import render_to_string
from django.core.urlresolvers import reverse as urlreverse from django.core.urlresolvers import reverse as urlreverse
from django.template import RequestContext from django.template import RequestContext
from django import forms from django import forms
from django.forms.util import ErrorList from django.utils.html import escape
from django.utils.html import strip_tags, escape
from django.utils.safestring import mark_safe from django.utils.safestring import mark_safe
from django.conf import settings from django.conf import settings
from django.contrib import messages from django.contrib import messages
import debug # pyflakes:ignore
from ietf.doc.models import ( Document, DocHistory, State, DocEvent, BallotDocEvent,
BallotPositionDocEvent, InitialReviewDocEvent, NewRevisionDocEvent, TelechatDocEvent,
WriteupDocEvent, save_document_in_history )
from ietf.doc.utils import ( add_state_change_event, close_open_ballots,
create_ballot_if_not_open, get_chartering_type, update_telechat )
from ietf.doc.utils_charter import ( historic_milestones_for_charter,
approved_revision, default_review_text, default_action_text, email_state_changed,
generate_ballot_writeup, generate_issue_ballot_mail, next_approved_revision, next_revision )
from ietf.group.models import ChangeStateGroupEvent, MilestoneGroupEvent
from ietf.group.utils import save_group_in_history, save_milestone_in_history
from ietf.iesg.models import TelechatDate
from ietf.ietfauth.utils import has_role, role_required
from ietf.name.models import GroupStateName
from ietf.person.models import Person
from ietf.utils.history import find_history_active_at
from ietf.utils.mail import send_mail_preformatted from ietf.utils.mail import send_mail_preformatted
from ietf.utils.textupload import get_cleaned_text_file_content from ietf.utils.textupload import get_cleaned_text_file_content
from ietf.utils.history import find_history_active_at
from ietf.ietfauth.utils import has_role, role_required
from ietf.iesg.models import TelechatDate
from ietf.doc.models import *
from ietf.doc.utils import *
from ietf.name.models import *
from ietf.person.models import *
from ietf.group.models import *
from ietf.group.utils import save_group_in_history, save_milestone_in_history
from ietf.wginfo.mails import email_secretariat from ietf.wginfo.mails import email_secretariat
from ietf.doc.utils_charter import *
import debug
class ChangeStateForm(forms.Form): class ChangeStateForm(forms.Form):
charter_state = forms.ModelChoiceField(State.objects.filter(used=True, type="charter", slug__in=["infrev", "intrev", "extrev", "iesgrev"]), label="Charter state", empty_label=None, required=False) charter_state = forms.ModelChoiceField(State.objects.filter(used=True, type="charter", slug__in=["infrev", "intrev", "extrev", "iesgrev"]), label="Charter state", empty_label=None, required=False)
@ -598,7 +602,6 @@ def approve(request, name):
new_state = GroupStateName.objects.get(slug="active") new_state = GroupStateName.objects.get(slug="active")
if group.state != new_state: if group.state != new_state:
save_group_in_history(group) save_group_in_history(group)
prev_state = group.state
group.state = new_state group.state = new_state
group.time = e.time group.time = e.time
group.save() group.save()

View file

@ -8,21 +8,18 @@ from django.template import RequestContext
from django.template.loader import render_to_string from django.template.loader import render_to_string
from django.conf import settings from django.conf import settings
from ietf.doc.utils import add_state_change_event, update_telechat from ietf.doc.models import ( BallotDocEvent, BallotPositionDocEvent, DocAlias, DocEvent,
from ietf.doc.models import save_document_in_history Document, NewRevisionDocEvent, State, TelechatDocEvent, save_document_in_history )
from ietf.doc.utils import create_ballot_if_not_open, close_open_ballots, get_document_content from ietf.doc.utils import ( add_state_change_event, close_open_ballots,
from ietf.ietfauth.utils import has_role, role_required, is_authorized_in_doc_stream create_ballot_if_not_open, get_document_content, update_telechat )
from ietf.utils.textupload import get_cleaned_text_file_content
from ietf.utils.mail import send_mail_preformatted
from ietf.doc.mails import email_iana from ietf.doc.mails import email_iana
from ietf.doc.models import State, Document, DocHistory, DocAlias
from ietf.doc.models import DocEvent, NewRevisionDocEvent, WriteupDocEvent, TelechatDocEvent, BallotDocEvent, BallotPositionDocEvent
from ietf.person.models import Person
from ietf.iesg.models import TelechatDate
from ietf.group.models import Role, Group
from ietf.doc.forms import TelechatForm, AdForm, NotifyForm from ietf.doc.forms import TelechatForm, AdForm, NotifyForm
from ietf.group.models import Role, Group
from ietf.iesg.models import TelechatDate
from ietf.ietfauth.utils import has_role, role_required, is_authorized_in_doc_stream
from ietf.person.models import Person
from ietf.utils.mail import send_mail_preformatted
from ietf.utils.textupload import get_cleaned_text_file_content
class ChangeStateForm(forms.Form): class ChangeStateForm(forms.Form):
review_state = forms.ModelChoiceField(State.objects.filter(used=True, type="conflrev"), label="Conflict review state", empty_label=None, required=True) review_state = forms.ModelChoiceField(State.objects.filter(used=True, type="conflrev"), label="Conflict review state", empty_label=None, required=True)

View file

@ -30,28 +30,33 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import re, os, datetime, urllib, json import os, datetime, urllib, json
from django.http import HttpResponse, Http404 from django.http import HttpResponse, Http404
from django.shortcuts import render_to_response, get_object_or_404, redirect from django.shortcuts import render_to_response, get_object_or_404, redirect
from django.template import RequestContext from django.template import RequestContext
from django.template.loader import render_to_string from django.template.loader import render_to_string
from django.template.defaultfilters import truncatewords_html
from django.utils.decorators import decorator_from_middleware from django.utils.decorators import decorator_from_middleware
from django.middleware.gzip import GZipMiddleware from django.middleware.gzip import GZipMiddleware
from django.core.exceptions import ObjectDoesNotExist from django.core.exceptions import ObjectDoesNotExist
from django.core.urlresolvers import reverse as urlreverse, NoReverseMatch from django.core.urlresolvers import reverse as urlreverse
from django.conf import settings from django.conf import settings
from django import forms from django import forms
from ietf.doc.models import ( Document, DocAlias, DocHistory, DocEvent, BallotDocEvent,
ConsensusDocEvent, NewRevisionDocEvent, TelechatDocEvent, WriteupDocEvent,
IESG_BALLOT_ACTIVE_STATES)
from ietf.doc.utils import ( add_links_in_new_revision_events, augment_events_with_revision,
can_adopt_draft, get_chartering_type, get_document_content, get_tags_for_stream_id,
needed_ballot_positions, nice_consensus, prettify_std_name)
from ietf.community.models import CommunityList from ietf.community.models import CommunityList
from ietf.doc.models import *
from ietf.doc.utils import *
from ietf.utils.history import find_history_active_at
from ietf.ietfauth.utils import *
from ietf.doc.views_status_change import RELATION_SLUGS as status_change_relationships
from ietf.ipr.models import IprDocAlias
from ietf.doc.mails import email_ad from ietf.doc.mails import email_ad
from ietf.doc.views_status_change import RELATION_SLUGS as status_change_relationships
from ietf.group.models import Role
from ietf.ietfauth.utils import has_role, is_authorized_in_doc_stream, user_is_person, role_required
from ietf.name.models import StreamName, BallotPositionName
from ietf.person.models import Email
from ietf.utils.history import find_history_active_at
def render_document_top(request, doc, tab, name): def render_document_top(request, doc, tab, name):
tabs = [] tabs = []
@ -137,7 +142,6 @@ def document_main(request, name, rev=None):
split_content = not ( request.GET.get('include_text') or request.COOKIES.get("full_draft", "") == "on" ) split_content = not ( request.GET.get('include_text') or request.COOKIES.get("full_draft", "") == "on" )
iesg_state = doc.get_state("draft-iesg") iesg_state = doc.get_state("draft-iesg")
iesg_substate = doc.tags.filter(slug__in=IESG_SUBSTATE_TAGS)
iesg_state_summary = doc.friendly_state() iesg_state_summary = doc.friendly_state()
can_edit = has_role(request.user, ("Area Director", "Secretariat")) can_edit = has_role(request.user, ("Area Director", "Secretariat"))
stream_slugs = StreamName.objects.values_list("slug", flat=True) stream_slugs = StreamName.objects.values_list("slug", flat=True)

View file

@ -1,37 +1,39 @@
# changing state and metadata on Internet Drafts # changing state and metadata on Internet Drafts
import re, os, datetime, json import datetime, json
from textwrap import dedent
from django.http import HttpResponse, HttpResponseRedirect, HttpResponseForbidden, Http404 from django import forms
from django.http import HttpResponseRedirect, HttpResponseForbidden, Http404
from django.shortcuts import render_to_response, get_object_or_404, redirect from django.shortcuts import render_to_response, get_object_or_404, redirect
from django.core.urlresolvers import reverse as urlreverse
from django.template.loader import render_to_string from django.template.loader import render_to_string
from django.template import RequestContext from django.template import RequestContext
from django import forms
from django.utils.html import strip_tags
from django.db.models import Max
from django.conf import settings from django.conf import settings
from django.forms.util import ErrorList from django.forms.util import ErrorList
from django.contrib.auth.decorators import login_required from django.contrib.auth.decorators import login_required
from django.template.defaultfilters import pluralize from django.template.defaultfilters import pluralize
from ietf.utils.mail import send_mail_text, send_mail_message from ietf.doc.models import ( Document, DocAlias, DocRelationshipName, RelatedDocument, State,
from ietf.ietfauth.utils import role_required StateType, DocEvent, ConsensusDocEvent, TelechatDocEvent, WriteupDocEvent, IESG_SUBSTATE_TAGS,
from ietf.ietfauth.utils import has_role, is_authorized_in_doc_stream, user_is_person save_document_in_history )
from ietf.iesg.models import TelechatDate from ietf.doc.mails import ( email_ad, email_pulled_from_rfc_queue, email_resurrect_requested,
from ietf.doc.mails import * email_resurrection_completed, email_state_changed, email_stream_changed,
email_stream_state_changed, email_stream_tags_changed, extra_automation_headers,
generate_publication_request, html_to_text )
from ietf.doc.utils import ( add_state_change_event, can_adopt_draft,
get_tags_for_stream_id, nice_consensus,
update_reminder, update_telechat )
from ietf.doc.lastcall import request_last_call from ietf.doc.lastcall import request_last_call
from ietf.utils.textupload import get_cleaned_text_file_content from ietf.group.models import Group, Role
from ietf.person.forms import EmailsField from ietf.iesg.models import TelechatDate
from ietf.group.models import Group from ietf.ietfauth.utils import has_role, is_authorized_in_doc_stream, user_is_person
from ietf.secr.lib import jsonapi from ietf.ietfauth.utils import role_required
from ietf.doc.models import *
from ietf.doc.utils import *
from ietf.name.models import IntendedStdLevelName, DocTagName, StreamName
from ietf.person.models import Person, Email
from ietf.message.models import Message from ietf.message.models import Message
from ietf.name.models import IntendedStdLevelName, DocTagName, StreamName
from ietf.person.forms import EmailsField
from ietf.person.models import Person, Email
from ietf.secr.lib.template import jsonapi
from ietf.utils.mail import send_mail, send_mail_message
from ietf.utils.textupload import get_cleaned_text_file_content
class ChangeStateForm(forms.Form): class ChangeStateForm(forms.Form):
state = forms.ModelChoiceField(State.objects.filter(used=True, type="draft-iesg"), empty_label=None, required=True) state = forms.ModelChoiceField(State.objects.filter(used=True, type="draft-iesg"), empty_label=None, required=True)
@ -42,7 +44,7 @@ class ChangeStateForm(forms.Form):
retclean = self.cleaned_data retclean = self.cleaned_data
state = self.cleaned_data.get('state', '(None)') state = self.cleaned_data.get('state', '(None)')
tag = self.cleaned_data.get('substate','') tag = self.cleaned_data.get('substate','')
comment = self.cleaned_data['comment'].strip() comment = self.cleaned_data['comment'].strip() # pyflakes:ignore
doc = get_object_or_404(Document, docalias__name=self.docname) doc = get_object_or_404(Document, docalias__name=self.docname)
prev = doc.get_state("draft-iesg") prev = doc.get_state("draft-iesg")
@ -327,7 +329,7 @@ class ReplacesForm(forms.Form):
for id in ids: for id in ids:
try: try:
d = DocAlias.objects.get(pk=id) d = DocAlias.objects.get(pk=id)
except DocAlias.DoesNotExist, e: except DocAlias.DoesNotExist:
raise forms.ValidationError("ERROR: %s not found for id %d" % DocAlias._meta.verbos_name, id) raise forms.ValidationError("ERROR: %s not found for id %d" % DocAlias._meta.verbos_name, id)
if d.document == self.doc: if d.document == self.doc:
raise forms.ValidationError("ERROR: A draft can't replace itself") raise forms.ValidationError("ERROR: A draft can't replace itself")
@ -509,7 +511,7 @@ def get_initial_notify(doc):
else: else:
receivers.append("%s-chairs@%s" % (doc.group.acronym, settings.TOOLS_SERVER)) receivers.append("%s-chairs@%s" % (doc.group.acronym, settings.TOOLS_SERVER))
for editor in Email.objects.filter(role__name="editor", role__group=doc.group): for editor in Email.objects.filter(role__name="editor", role__group=doc.group):
receivers.append(e.address) receivers.append(editor.address)
receivers.append("%s@%s" % (doc.name, settings.TOOLS_SERVER)) receivers.append("%s@%s" % (doc.name, settings.TOOLS_SERVER))
return ", ".join(receivers) return ", ".join(receivers)

View file

@ -1,9 +1,9 @@
from django import forms
from django.shortcuts import render_to_response, get_object_or_404 from django.shortcuts import render_to_response, get_object_or_404
from django.template import RequestContext from django.template import RequestContext
from django.http import Http404 from django.http import Http404
from ietf.doc.models import * from ietf.doc.models import State, StateType, IESG_SUBSTATE_TAGS
from ietf.name.models import DocRelationshipName, DocTagName
from ietf.doc.utils import get_tags_for_stream_id from ietf.doc.utils import get_tags_for_stream_id
def state_help(request, type): def state_help(request, type):

View file

@ -30,23 +30,25 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import re, datetime import datetime
from django import forms from django import forms
from django.shortcuts import render_to_response from django.shortcuts import render_to_response
from django.db.models import Q from django.db.models import Q
from django.template import RequestContext from django.template import RequestContext
from django.http import Http404, HttpResponse, HttpResponseBadRequest from django.http import Http404, HttpResponseBadRequest
import debug # pyflakes:ignore
from ietf.doc.models import ( Document, DocAlias, State, RelatedDocument, DocEvent,
LastCallDocEvent, TelechatDocEvent, IESG_SUBSTATE_TAGS )
from ietf.doc.expire import expirable_draft from ietf.doc.expire import expirable_draft
from ietf.utils import normalize_draftname from ietf.group.models import Group
from ietf.doc.models import *
from ietf.person.models import *
from ietf.group.models import *
from ietf.ipr.models import IprDocAlias
from ietf.idindex.index import active_drafts_index_by_group from ietf.idindex.index import active_drafts_index_by_group
from ietf.ipr.models import IprDocAlias
import debug from ietf.name.models import DocTagName, DocTypeName, StreamName
from ietf.person.models import Person
from ietf.utils.draft_search import normalize_draftname
class SearchForm(forms.Form): class SearchForm(forms.Form):
name = forms.CharField(required=False) name = forms.CharField(required=False)
@ -81,7 +83,7 @@ class SearchForm(forms.Form):
active_ads.sort(key=extract_last_name) active_ads.sort(key=extract_last_name)
inactive_ads.sort(key=extract_last_name) inactive_ads.sort(key=extract_last_name)
self.fields['ad'].choices = c = [('', 'any AD')] + [(ad.pk, ad.plain_name()) for ad in active_ads] + [('', '------------------')] + [(ad.pk, ad.name) for ad in inactive_ads] self.fields['ad'].choices = [('', 'any AD')] + [(ad.pk, ad.plain_name()) for ad in active_ads] + [('', '------------------')] + [(ad.pk, ad.name) for ad in inactive_ads]
self.fields['substate'].choices = [('', 'any substate'), ('0', 'no substate')] + [(n.slug, n.name) for n in DocTagName.objects.filter(slug__in=IESG_SUBSTATE_TAGS)] self.fields['substate'].choices = [('', 'any substate'), ('0', 'no substate')] + [(n.slug, n.name) for n in DocTagName.objects.filter(slug__in=IESG_SUBSTATE_TAGS)]
def clean_name(self): def clean_name(self):

View file

@ -8,23 +8,20 @@ from django.template import RequestContext
from django.template.loader import render_to_string from django.template.loader import render_to_string
from django.conf import settings from django.conf import settings
from ietf.doc.utils import add_state_change_event, update_telechat from ietf.doc.models import ( Document, DocAlias, State, DocEvent, BallotDocEvent,
from ietf.doc.models import save_document_in_history BallotPositionDocEvent, NewRevisionDocEvent, TelechatDocEvent, WriteupDocEvent,
save_document_in_history )
from ietf.doc.utils import create_ballot_if_not_open, close_open_ballots, get_document_content
from ietf.ietfauth.utils import has_role, role_required
from ietf.utils.textupload import get_cleaned_text_file_content
from ietf.utils.mail import send_mail_preformatted
from ietf.doc.models import State, Document, DocHistory, DocAlias
from ietf.doc.models import DocEvent, NewRevisionDocEvent, WriteupDocEvent, TelechatDocEvent, BallotDocEvent, BallotPositionDocEvent
from ietf.person.models import Person
from ietf.iesg.models import TelechatDate
from ietf.group.models import Group
from ietf.name.models import DocRelationshipName, StdLevelName
from ietf.doc.forms import TelechatForm, AdForm, NotifyForm from ietf.doc.forms import TelechatForm, AdForm, NotifyForm
from ietf.doc.views_ballot import LastCallTextForm
from ietf.doc.lastcall import request_last_call from ietf.doc.lastcall import request_last_call
from ietf.doc.utils import get_document_content, add_state_change_event, update_telechat, close_open_ballots, create_ballot_if_not_open
from ietf.doc.views_ballot import LastCallTextForm
from ietf.group.models import Group
from ietf.iesg.models import TelechatDate
from ietf.ietfauth.utils import has_role, role_required
from ietf.name.models import DocRelationshipName, StdLevelName
from ietf.person.models import Person
from ietf.utils.mail import send_mail_preformatted
from ietf.utils.textupload import get_cleaned_text_file_content
class ChangeStateForm(forms.Form): class ChangeStateForm(forms.Form):
new_state = forms.ModelChoiceField(State.objects.filter(type="statchg", used=True), label="Status Change Evaluation State", empty_label=None, required=True) new_state = forms.ModelChoiceField(State.objects.filter(type="statchg", used=True), label="Status Change Evaluation State", empty_label=None, required=True)

View file

@ -1,4 +1,4 @@
from django.conf.urls import patterns, url from django.conf.urls import patterns
from django.views.generic import RedirectView from django.views.generic import RedirectView
from ietf.doc.feeds import DocumentChangesFeed, InLastCallFeed from ietf.doc.feeds import DocumentChangesFeed, InLastCallFeed

View file

@ -1,7 +1,7 @@
from functools import update_wrapper from functools import update_wrapper
from django.contrib import admin
from django import template from django import template
from django.contrib import admin
from django.contrib.admin.util import unquote from django.contrib.admin.util import unquote
from django.core.exceptions import PermissionDenied from django.core.exceptions import PermissionDenied
from django.core.management import load_command_class from django.core.management import load_command_class
@ -11,7 +11,7 @@ from django.utils.encoding import force_unicode
from django.utils.html import escape from django.utils.html import escape
from django.utils.translation import ugettext as _ from django.utils.translation import ugettext as _
from ietf.group.models import * from ietf.group.models import Group, GroupHistory, GroupEvent, GroupURL, GroupMilestone, Role, RoleHistory, ChangeStateGroupEvent
class RoleInline(admin.TabularInline): class RoleInline(admin.TabularInline):
model = Role model = Role

View file

@ -1,9 +1,7 @@
import datetime
import logging
import json import json
from django.http import HttpResponse
from django.shortcuts import get_object_or_404 from django.shortcuts import get_object_or_404
from django.http import HttpResponse, Http404
from ietf.group.models import Group from ietf.group.models import Group

View file

@ -1,5 +1,4 @@
# encoding: utf-8 # encoding: utf-8
import datetime
from south.db import db from south.db import db
from south.v2 import SchemaMigration from south.v2 import SchemaMigration
from django.db import models from django.db import models

View file

@ -1,8 +1,6 @@
# encoding: utf-8 # encoding: utf-8
import datetime import datetime
from south.db import db
from south.v2 import DataMigration from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration): class Migration(DataMigration):

View file

@ -1,8 +1,6 @@
# encoding: utf-8 # encoding: utf-8
import datetime
from south.db import db from south.db import db
from south.v2 import SchemaMigration from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration): class Migration(SchemaMigration):

View file

@ -1,5 +1,4 @@
# encoding: utf-8 # encoding: utf-8
import datetime
from south.db import db from south.db import db
from south.v2 import SchemaMigration from south.v2 import SchemaMigration
from django.db import models from django.db import models

View file

@ -1,8 +1,6 @@
# encoding: utf-8 # encoding: utf-8
import datetime
from south.db import db from south.db import db
from south.v2 import SchemaMigration from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration): class Migration(SchemaMigration):

View file

@ -1,16 +1,15 @@
# Copyright The IETF Trust 2007, All Rights Reserved # Copyright The IETF Trust 2007, All Rights Reserved
import datetime
from urlparse import urljoin from urlparse import urljoin
from django.db import models from django.db import models
from django.db.models import Q
from ietf.name.models import *
from ietf.person.models import Email, Person
from ietf.group.colors import fg_group_colors, bg_group_colors from ietf.group.colors import fg_group_colors, bg_group_colors
from ietf.name.models import GroupStateName, GroupTypeName, DocTagName, GroupMilestoneStateName, RoleName
from ietf.person.models import Email, Person
import datetime import debug # pyflakes:ignore
import debug
class GroupInfo(models.Model): class GroupInfo(models.Model):
time = models.DateTimeField(default=datetime.datetime.now) time = models.DateTimeField(default=datetime.datetime.now)

View file

@ -1,6 +1,6 @@
# Copyright The IETF Trust 2008, All Rights Reserved # Copyright The IETF Trust 2008, All Rights Reserved
from django.conf.urls import patterns, include from django.conf.urls import patterns
import views_stream import views_stream

View file

@ -1,17 +1,9 @@
import os, shutil, datetime
import django.test
from django.core.urlresolvers import reverse as urlreverse from django.core.urlresolvers import reverse as urlreverse
from pyquery import PyQuery from ietf.group.models import Role
from ietf.utils.mail import outbox
from ietf.utils.test_utils import login_testing_unauthorized, TestCase
from ietf.utils.test_data import make_test_data from ietf.utils.test_data import make_test_data
from ietf.utils.test_utils import login_testing_unauthorized, TestCase
from ietf.name.models import *
from ietf.group.models import *
from ietf.person.models import *
class StreamTests(TestCase): class StreamTests(TestCase):
def test_streams(self): def test_streams(self):

View file

@ -1,6 +1,6 @@
# Copyright The IETF Trust 2007, All Rights Reserved # Copyright The IETF Trust 2007, All Rights Reserved
from django.conf.urls import patterns, url from django.conf.urls import patterns
urlpatterns = patterns('', urlpatterns = patterns('',
(r'^(?P<acronym>[a-z0-9]+).json$', 'ietf.group.ajax.group_json'), (r'^(?P<acronym>[a-z0-9]+).json$', 'ietf.group.ajax.group_json'),

View file

@ -2,7 +2,8 @@ import os
from django.conf import settings from django.conf import settings
from ietf.group.models import * from ietf.group.models import Group, RoleHistory
from ietf.person.models import Email
from ietf.utils.history import get_history_object_for, copy_many_to_many_for_history from ietf.utils.history import get_history_object_for, copy_many_to_many_for_history

View file

@ -1,19 +1,19 @@
# Copyright The IETF Trust 2008, All Rights Reserved # Copyright The IETF Trust 2008, All Rights Reserved
from django.shortcuts import render_to_response, get_object_or_404, redirect from django.shortcuts import render_to_response, get_object_or_404, redirect
from django.template import RequestContext, loader from django.template import RequestContext
from django.http import Http404, HttpResponse, HttpResponseForbidden from django.http import Http404, HttpResponseForbidden
from django import forms from django import forms
from ietf.group.models import *
from ietf.group.utils import *
from ietf.doc.models import Document
from ietf.doc.views_search import SearchForm, retrieve_search_results from ietf.doc.views_search import SearchForm, retrieve_search_results
from ietf.name.models import StreamName from ietf.group.models import Group, GroupEvent, Role
from ietf.group.utils import save_group_in_history
from ietf.ietfauth.utils import has_role from ietf.ietfauth.utils import has_role
from ietf.name.models import StreamName
from ietf.person.forms import EmailsField from ietf.person.forms import EmailsField
from ietf.person.models import Email
import debug import debug # pyflakes:ignore
def streams(request): def streams(request):
streams = [ s.slug for s in StreamName.objects.all().exclude(slug__in=['ietf', 'legacy']) ] streams = [ s.slug for s in StreamName.objects.all().exclude(slug__in=['ietf', 'legacy']) ]

View file

@ -5,7 +5,7 @@ unittest). These will both pass when you run "manage.py test".
Replace these with more appropriate tests for your application. Replace these with more appropriate tests for your application.
""" """
from ietf.utils import TestCase from ietf.utils.test_utils import TestCase
class SimpleTest(TestCase): class SimpleTest(TestCase):
def test_basic_addition(self): def test_basic_addition(self):

View file

@ -5,7 +5,7 @@ import os
from django.template import RequestContext from django.template import RequestContext
from django.shortcuts import get_object_or_404, render_to_response from django.shortcuts import get_object_or_404, render_to_response
import debug import debug # pyflakes:ignore
from ietf.doc.models import State, StateType from ietf.doc.models import State, StateType

View file

@ -9,7 +9,11 @@ from django.conf import settings
from django.template.loader import render_to_string from django.template.loader import render_to_string
from ietf.doc.templatetags.ietf_filters import clean_whitespace from ietf.doc.templatetags.ietf_filters import clean_whitespace
from ietf.doc.models import * from ietf.doc.models import Document, DocEvent, DocumentAuthor, RelatedDocument, DocAlias, State
from ietf.doc.models import LastCallDocEvent, NewRevisionDocEvent
from ietf.doc.models import IESG_SUBSTATE_TAGS
from ietf.group.models import Group
from ietf.person.models import Person
def all_id_txt(): def all_id_txt():
# this returns a lot of data so try to be efficient # this returns a lot of data so try to be efficient

View file

@ -1,13 +1,14 @@
import datetime, shutil import os
import datetime
import shutil
from django.core.urlresolvers import reverse as urlreverse from django.conf import settings
from ietf.doc.models import Document, DocAlias, RelatedDocument, State, LastCallDocEvent, NewRevisionDocEvent
from ietf.name.models import DocRelationshipName
from ietf.idindex.index import all_id_txt, all_id2_txt, id_index_txt
from ietf.utils.test_utils import TestCase
from ietf.utils.test_data import make_test_data from ietf.utils.test_data import make_test_data
from ietf.utils import TestCase
from ietf.doc.models import *
from ietf.idindex.index import *
class IndexTests(TestCase): class IndexTests(TestCase):
def setUp(self): def setUp(self):

View file

@ -2,7 +2,6 @@
# coding: latin-1 # coding: latin-1
from types import ModuleType from types import ModuleType
import urls, models, views, feeds, admin
# These people will be sent a stack trace if there's an uncaught exception in # These people will be sent a stack trace if there's an uncaught exception in
# code any of the modules imported above: # code any of the modules imported above:

View file

@ -1,5 +1,6 @@
from django.contrib import admin from django.contrib import admin
from ietf.iesg.models import *
from ietf.iesg.models import TelechatDate, TelechatAgendaItem
class TelechatAgendaItemAdmin(admin.ModelAdmin): class TelechatAgendaItemAdmin(admin.ModelAdmin):
pass pass

View file

@ -1,15 +1,15 @@
# utilities for constructing agendas for IESG telechats # utilities for constructing agendas for IESG telechats
import codecs, re, os, datetime import codecs
import datetime
from collections import OrderedDict from collections import OrderedDict
from django.http import Http404
from django.conf import settings from django.conf import settings
from django.http import Http404
from ietf.doc.models import Document, TelechatDocEvent, LastCallDocEvent, ConsensusDocEvent
from ietf.iesg.models import TelechatDate, TelechatAgendaItem from ietf.iesg.models import TelechatDate, TelechatAgendaItem
from ietf.doc.models import Document, TelechatDocEvent, LastCallDocEvent, ConsensusDocEvent, DocEvent
from ietf.group.models import Group, GroupMilestone
def get_agenda_date(date=None): def get_agenda_date(date=None):
if not date: if not date:
@ -152,7 +152,6 @@ def fill_in_agenda_docs(date, sections, matches=None):
matches = Document.objects.filter(docevent__telechatdocevent__telechat_date=date) matches = Document.objects.filter(docevent__telechatdocevent__telechat_date=date)
matches = matches.select_related("stream", "group").distinct() matches = matches.select_related("stream", "group").distinct()
docs = []
for doc in matches: for doc in matches:
if doc.latest_event(TelechatDocEvent, type="scheduled_for_telechat").telechat_date != date: if doc.latest_event(TelechatDocEvent, type="scheduled_for_telechat").telechat_date != date:
continue continue

View file

@ -35,7 +35,6 @@
import datetime import datetime
from django.db import models from django.db import models
from django.conf import settings
class TelechatAgendaItem(models.Model): class TelechatAgendaItem(models.Model):
TYPE_CHOICES = ( TYPE_CHOICES = (

View file

@ -1,18 +1,22 @@
import os, shutil, json import os
import shutil
import json
import datetime
from django.core.urlresolvers import reverse as urlreverse
from django.conf import settings from django.conf import settings
from django.core.urlresolvers import reverse as urlreverse
from pyquery import PyQuery from pyquery import PyQuery
from ietf.utils.test_data import make_test_data from ietf.doc.models import DocEvent, BallotDocEvent, BallotPositionDocEvent, TelechatDocEvent
from ietf.doc.models import * from ietf.doc.models import Document, DocAlias, State, RelatedDocument
from ietf.person.models import Person
from ietf.group.models import Group, GroupMilestone from ietf.group.models import Group, GroupMilestone
from ietf.name.models import StreamName
from ietf.iesg.models import *
from ietf.utils.test_utils import TestCase, login_testing_unauthorized
from ietf.iesg.agenda import get_agenda_date, agenda_data from ietf.iesg.agenda import get_agenda_date, agenda_data
from ietf.iesg.models import TelechatDate
from ietf.name.models import StreamName
from ietf.person.models import Person
from ietf.utils.test_data import make_test_data
from ietf.utils.test_utils import TestCase, login_testing_unauthorized
class IESGTests(TestCase): class IESGTests(TestCase):
def test_feed(self): def test_feed(self):
@ -403,7 +407,6 @@ class RescheduleOnAgendaTests(TestCase):
e.save() e.save()
form_id = draft.pk form_id = draft.pk
telechat_date_before = e.telechat_date
url = urlreverse('ietf.iesg.views.agenda_documents') url = urlreverse('ietf.iesg.views.agenda_documents')

View file

@ -32,8 +32,7 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
from django.conf.urls import patterns, url from django.conf.urls import patterns
from django.conf import settings
from django.views.generic import RedirectView from django.views.generic import RedirectView
urlpatterns = patterns('', urlpatterns = patterns('',

View file

@ -32,28 +32,30 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import codecs, re, os, glob, datetime import os
import tarfile, StringIO, time import datetime
import tarfile
import StringIO
import time
import itertools import itertools
import json import json
from django.core.urlresolvers import reverse as urlreverse
from django.http import Http404, HttpResponse, HttpResponseForbidden, HttpResponseRedirect from django import forms
from django.template import RequestContext, Context, loader
from django.shortcuts import render_to_response, get_object_or_404, render, redirect
from django.conf import settings from django.conf import settings
from django.db import models from django.db import models
from django import forms from django.http import HttpResponse
from django.shortcuts import render_to_response, render, redirect
from django.template import RequestContext
from ietf.iesg.models import TelechatDate, TelechatAgendaItem
from ietf.ipr.models import IprDocAlias
from ietf.doc.models import Document, TelechatDocEvent, LastCallDocEvent, ConsensusDocEvent, DocEvent, IESG_BALLOT_ACTIVE_STATES from ietf.doc.models import Document, TelechatDocEvent, LastCallDocEvent, ConsensusDocEvent, DocEvent, IESG_BALLOT_ACTIVE_STATES
from ietf.group.models import Group, GroupMilestone
from ietf.person.models import Person
from ietf.doc.utils import update_telechat, augment_events_with_revision from ietf.doc.utils import update_telechat, augment_events_with_revision
from ietf.group.models import GroupMilestone
from ietf.iesg.agenda import agenda_data, agenda_sections, fill_in_agenda_docs, get_agenda_date
from ietf.iesg.models import TelechatDate
from ietf.ietfauth.utils import has_role, role_required, user_is_person from ietf.ietfauth.utils import has_role, role_required, user_is_person
from ietf.iesg.agenda import * from ietf.person.models import Person
def review_decisions(request, year=None): def review_decisions(request, year=None):
events = DocEvent.objects.filter(type__in=("iesg_disapproved", "iesg_approved")) events = DocEvent.objects.filter(type__in=("iesg_disapproved", "iesg_approved"))

View file

@ -1 +1 @@
from django.db import models

View file

@ -32,7 +32,6 @@
from urlparse import urlsplit from urlparse import urlsplit
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse as urlreverse from django.core.urlresolvers import reverse as urlreverse
from ietf.utils.test_utils import TestCase, login_testing_unauthorized from ietf.utils.test_utils import TestCase, login_testing_unauthorized

View file

@ -6,9 +6,8 @@ from django.db.models import Q
from django.http import HttpResponseRedirect, HttpResponseForbidden from django.http import HttpResponseRedirect, HttpResponseForbidden
from django.contrib.auth import REDIRECT_FIELD_NAME from django.contrib.auth import REDIRECT_FIELD_NAME
from ietf.doc.models import Document
from ietf.person.models import Person
from ietf.group.models import Role from ietf.group.models import Role
from ietf.person.models import Person
def user_is_person(user, person): def user_is_person(user, person):
"""Test whether user is associated with person.""" """Test whether user is associated with person."""

View file

@ -45,11 +45,11 @@ from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import User from django.contrib.auth.models import User
from django.utils.http import urlquote from django.utils.http import urlquote
from django.utils.translation import ugettext as _ from django.utils.translation import ugettext as _
from django.core.exceptions import ValidationError, NON_FIELD_ERRORS from django.core.exceptions import ValidationError
from ietf.person.models import Person, Email, Alias
from ietf.group.models import Role from ietf.group.models import Role
from ietf.ietfauth.forms import RegistrationForm, PasswordForm, RecoverPasswordForm, TestEmailForm, PersonForm from ietf.ietfauth.forms import RegistrationForm, PasswordForm, RecoverPasswordForm, TestEmailForm, PersonForm
from ietf.person.models import Person, Email
def index(request): def index(request):
return render_to_response('registration/index.html', context_instance=RequestContext(request)) return render_to_response('registration/index.html', context_instance=RequestContext(request))
@ -108,7 +108,6 @@ def profile(request):
else: else:
roles = Role.objects.filter(person=person,group__state='active').order_by('name__name','group__name') roles = Role.objects.filter(person=person,group__state='active').order_by('name__name','group__name')
emails = Email.objects.filter(person=person).order_by('-active','-time') emails = Email.objects.filter(person=person).order_by('-active','-time')
aliases = Alias.objects.filter(person=person)
person_form = PersonForm(instance=person) person_form = PersonForm(instance=person)

View file

@ -1,7 +1,6 @@
#coding: utf-8 #coding: utf-8
from django.contrib import admin from django.contrib import admin
from django.conf import settings from ietf.ipr.models import IprContact, IprDetail, IprDocAlias, IprNotification, IprUpdate
from ietf.ipr.models import *
class IprContactAdmin(admin.ModelAdmin): class IprContactAdmin(admin.ModelAdmin):
list_display=('__str__', 'ipr') list_display=('__str__', 'ipr')

View file

@ -8,7 +8,7 @@ from django.http import Http404
from django.conf import settings from django.conf import settings
from django import forms from django import forms
from ietf.utils import log from ietf.utils.log import log
from ietf.utils.mail import send_mail from ietf.utils.mail import send_mail
from ietf.doc.models import Document, DocAlias from ietf.doc.models import Document, DocAlias
from ietf.ipr.models import IprDetail, IprDocAlias, IprContact, LICENSE_CHOICES, IprUpdate from ietf.ipr.models import IprDetail, IprDocAlias, IprContact, LICENSE_CHOICES, IprUpdate
@ -190,8 +190,7 @@ def new(request, type, update=None, submitter=None):
for subfield in ["name", "title", "department", "address1", "address2", "telephone", "fax", "email"]: for subfield in ["name", "title", "department", "address1", "address2", "telephone", "fax", "email"]:
try: try:
data[ "subm_%s" % subfield ] = data[ "%s_%s" % (src,subfield) ] data[ "subm_%s" % subfield ] = data[ "%s_%s" % (src,subfield) ]
except Exception, e: except Exception:
#log("Caught exception: %s"%e)
pass pass
form = IprForm(data) form = IprForm(data)
if form.is_valid(): if form.is_valid():

View file

@ -11,7 +11,7 @@ from django.conf import settings
from ietf.ipr.models import IprDocAlias, IprDetail from ietf.ipr.models import IprDocAlias, IprDetail
from ietf.ipr.related import related_docs from ietf.ipr.related import related_docs
from ietf.utils import log, normalize_draftname from ietf.utils.draft_search import normalize_draftname
from ietf.group.models import Group from ietf.group.models import Group
from ietf.doc.models import DocAlias from ietf.doc.models import DocAlias

View file

@ -1,5 +1,5 @@
import os, datetime, shutil import os
import shutil
import urllib import urllib
from pyquery import PyQuery from pyquery import PyQuery
@ -7,10 +7,10 @@ from pyquery import PyQuery
from django.conf import settings from django.conf import settings
from django.core.urlresolvers import reverse as urlreverse from django.core.urlresolvers import reverse as urlreverse
from ietf.utils.test_utils import TestCase, login_testing_unauthorized from ietf.doc.models import DocAlias
from ietf.ipr.models import IprDetail
from ietf.utils.test_utils import TestCase
from ietf.utils.test_data import make_test_data from ietf.utils.test_data import make_test_data
from ietf.utils.mail import outbox
from ietf.ipr.models import *
class IprTests(TestCase): class IprTests(TestCase):
@ -33,7 +33,7 @@ class IprTests(TestCase):
self.assertTrue(ipr.title in r.content) self.assertTrue(ipr.title in r.content)
def test_ipr_details(self): def test_ipr_details(self):
draft = make_test_data() make_test_data()
ipr = IprDetail.objects.get(title="Statement regarding rights") ipr = IprDetail.objects.get(title="Statement regarding rights")
r = self.client.get(urlreverse("ipr_show", kwargs=dict(ipr_id=ipr.pk))) r = self.client.get(urlreverse("ipr_show", kwargs=dict(ipr_id=ipr.pk)))
@ -148,7 +148,7 @@ class IprTests(TestCase):
self.assertTrue("/ipr/%s/" % ipr.pk in r.content) self.assertTrue("/ipr/%s/" % ipr.pk in r.content)
def test_new_generic(self): def test_new_generic(self):
draft = make_test_data() make_test_data()
url = urlreverse("ietf.ipr.new.new", kwargs={ "type": "generic" }) url = urlreverse("ietf.ipr.new.new", kwargs={ "type": "generic" })

View file

@ -4,13 +4,11 @@ import os
from django.shortcuts import render_to_response as render, get_object_or_404 from django.shortcuts import render_to_response as render, get_object_or_404
from django.template import RequestContext from django.template import RequestContext
from django.template.loader import render_to_string
from django.http import HttpResponse, Http404 from django.http import HttpResponse, Http404
from django.conf import settings from django.conf import settings
from ietf.ipr.models import IprDetail, IprDocAlias, SELECT_CHOICES, LICENSE_CHOICES from ietf.ipr.models import IprDetail, IprDocAlias, SELECT_CHOICES, LICENSE_CHOICES
from ietf.ipr.view_sections import section_list_for_ipr from ietf.ipr.view_sections import section_list_for_ipr
from ietf.doc.models import Document
def about(request): def about(request):
return render("ipr/disclosure.html", {}, context_instance=RequestContext(request)) return render("ipr/disclosure.html", {}, context_instance=RequestContext(request))

View file

@ -2,7 +2,6 @@
# coding: latin-1 # coding: latin-1
from types import ModuleType from types import ModuleType
import urls, models, views, forms, admin, utils, widgets, sitemaps, feeds
# These people will be sent a stack trace if there's an uncaught exception in # These people will be sent a stack trace if there's an uncaught exception in
# code any of the modules imported above: # code any of the modules imported above:

View file

@ -1,6 +1,6 @@
from django.contrib import admin from django.contrib import admin
from ietf.liaisons.models import * from ietf.liaisons.models import LiaisonStatement
class LiaisonStatementAdmin(admin.ModelAdmin): class LiaisonStatementAdmin(admin.ModelAdmin):
list_display = ['id', 'title', 'from_name', 'to_name', 'submitted', 'purpose', 'related_to'] list_display = ['id', 'title', 'from_name', 'to_name', 'submitted', 'purpose', 'related_to']

Some files were not shown because too many files have changed in this diff Show more