Merged in [11083] from stephen.farrell@cs.tcd.ie, with some tweaks:
Assigned default consensus for IETF stream documents, partly fixing #1403 - IRTF/IAB may want more, this just does IETF stream.
- Legacy-Id: 11089
Note: SVN reference [11083] has been migrated to Git commit 9ca4e98d46
This commit is contained in:
commit
c9cb6a6cee
|
@ -1,6 +1,6 @@
|
|||
# -*- conf-mode -*-
|
||||
|
||||
^/personal/anurag_nc/6.18.2.dev0@11071 # Doesn't pass tests, needs rework
|
||||
/personal/anurag_nc/6.18.2.dev0@11071 # Doesn't pass tests, needs rework
|
||||
/personal/rcross/v6.8.1.dev0@10727 # Loads of whitespace changes. Pyflakes issue already fixed
|
||||
/personal/lars/6.11.1.dev0@10537 # Downgrades the PT fonts to a limited unicode range, renames them, and removes copyright from css file.
|
||||
branch/iola/event-saving-refactor-r10076 @ 10190
|
||||
|
|
|
@ -12,7 +12,7 @@ from django.core.urlresolvers import reverse as urlreverse
|
|||
|
||||
from ietf.doc.models import Document, DocHistory, State
|
||||
from ietf.doc.models import DocAlias, RelatedDocument, BallotType, DocReminder
|
||||
from ietf.doc.models import DocEvent, BallotDocEvent, NewRevisionDocEvent, StateDocEvent
|
||||
from ietf.doc.models import DocEvent, ConsensusDocEvent, BallotDocEvent, NewRevisionDocEvent, StateDocEvent
|
||||
from ietf.doc.models import save_document_in_history
|
||||
from ietf.name.models import DocReminderTypeName, DocRelationshipName
|
||||
from ietf.group.models import Role
|
||||
|
@ -321,6 +321,20 @@ def prettify_std_name(n, spacing=" "):
|
|||
else:
|
||||
return n
|
||||
|
||||
def default_consensus(doc):
|
||||
# if someone edits the consensus return that, otherwise
|
||||
# ietf stream => true and irtf stream => false
|
||||
consensus = None
|
||||
e = doc.latest_event(ConsensusDocEvent, type="changed_consensus")
|
||||
if (e):
|
||||
return e.consensus
|
||||
if doc.stream_id == "ietf":
|
||||
consensus = True
|
||||
elif doc.stream_id == "irtf":
|
||||
consensus = False
|
||||
else: # ise, iab, legacy
|
||||
return consensus
|
||||
|
||||
def nice_consensus(consensus):
|
||||
mapping = {
|
||||
None: "Unknown",
|
||||
|
|
|
@ -49,7 +49,7 @@ from ietf.doc.models import ( Document, DocAlias, DocHistory, DocEvent, BallotDo
|
|||
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, update_telechat, has_same_ballot,
|
||||
get_initial_notify, make_notify_changed_event, crawl_history)
|
||||
get_initial_notify, make_notify_changed_event, crawl_history, default_consensus)
|
||||
from ietf.community.models import CommunityList
|
||||
from ietf.group.models import Role
|
||||
from ietf.group.utils import can_manage_group_type, can_manage_materials
|
||||
|
@ -282,7 +282,7 @@ def document_main(request, name, rev=None):
|
|||
can_edit_notify = can_edit_shepherd_writeup
|
||||
can_edit_consensus = False
|
||||
|
||||
consensus = None
|
||||
consensus = nice_consensus(default_consensus(doc))
|
||||
if doc.stream_id == "ietf" and iesg_state:
|
||||
show_in_states = set(IESG_BALLOT_ACTIVE_STATES)
|
||||
show_in_states.update(('approved','ann','rfcqueue','pub'))
|
||||
|
|
|
@ -26,7 +26,7 @@ from ietf.doc.mails import ( email_pulled_from_rfc_queue, email_resurrect_reques
|
|||
from ietf.doc.utils import ( add_state_change_event, can_adopt_draft,
|
||||
get_tags_for_stream_id, nice_consensus,
|
||||
update_reminder, update_telechat, make_notify_changed_event, get_initial_notify,
|
||||
set_replaces_for_document )
|
||||
set_replaces_for_document, default_consensus )
|
||||
from ietf.doc.lastcall import request_last_call
|
||||
from ietf.doc.fields import SearchableDocAliasesField
|
||||
from ietf.group.models import Group, Role
|
||||
|
@ -1103,7 +1103,7 @@ def edit_consensus(request, name):
|
|||
return HttpResponseForbidden("You do not have the necessary permissions to view this page")
|
||||
|
||||
e = doc.latest_event(ConsensusDocEvent, type="changed_consensus")
|
||||
prev_consensus = e and e.consensus
|
||||
prev_consensus = e.consensus if e else default_consensus(doc)
|
||||
|
||||
if request.method == 'POST':
|
||||
form = ConsensusForm(request.POST)
|
||||
|
@ -1214,8 +1214,10 @@ def request_publication(request, name):
|
|||
doc=doc,
|
||||
message=m,
|
||||
next_state=next_state,
|
||||
consensus_filled_in= ( (consensus_event != None) and (consensus_event.consensus != None) ),
|
||||
),
|
||||
consensus_filled_in=(
|
||||
True if (doc.stream_id and doc.stream_id=='ietf')
|
||||
else (consensus_event != None and consensus_event.consensus != None)),
|
||||
),
|
||||
context_instance = RequestContext(request))
|
||||
|
||||
class AdoptDraftForm(forms.Form):
|
||||
|
|
Loading…
Reference in a new issue