assigned default consensus for IETF stream documents partly fixing #1403 - IRTF/IAB may want more, this just does IETF stream. Commit ready to merge.
- Legacy-Id: 11073
This commit is contained in:
parent
9f90441aa6
commit
c93a31034b
|
@ -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 Document, DocHistory, State
|
||||||
from ietf.doc.models import DocAlias, RelatedDocument, BallotType, DocReminder
|
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.doc.models import save_document_in_history
|
||||||
from ietf.name.models import DocReminderTypeName, DocRelationshipName
|
from ietf.name.models import DocReminderTypeName, DocRelationshipName
|
||||||
from ietf.group.models import Role
|
from ietf.group.models import Role
|
||||||
|
@ -321,6 +321,19 @@ def prettify_std_name(n, spacing=" "):
|
||||||
else:
|
else:
|
||||||
return n
|
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
|
||||||
|
return consensus
|
||||||
|
|
||||||
def nice_consensus(consensus):
|
def nice_consensus(consensus):
|
||||||
mapping = {
|
mapping = {
|
||||||
None: "Unknown",
|
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,
|
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,
|
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,
|
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.community.models import CommunityList
|
||||||
from ietf.group.models import Role
|
from ietf.group.models import Role
|
||||||
from ietf.group.utils import can_manage_group_type, can_manage_materials
|
from ietf.group.utils import can_manage_group_type, can_manage_materials
|
||||||
|
@ -282,7 +282,8 @@ def document_main(request, name, rev=None):
|
||||||
can_edit_notify = can_edit_shepherd_writeup
|
can_edit_notify = can_edit_shepherd_writeup
|
||||||
can_edit_consensus = False
|
can_edit_consensus = False
|
||||||
|
|
||||||
consensus = None
|
consensus = default_consensus(doc)
|
||||||
|
consensus = nice_consensus(consensus)
|
||||||
if doc.stream_id == "ietf" and iesg_state:
|
if doc.stream_id == "ietf" and iesg_state:
|
||||||
show_in_states = set(IESG_BALLOT_ACTIVE_STATES)
|
show_in_states = set(IESG_BALLOT_ACTIVE_STATES)
|
||||||
show_in_states.update(('approved','ann','rfcqueue','pub'))
|
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,
|
from ietf.doc.utils import ( add_state_change_event, can_adopt_draft,
|
||||||
get_tags_for_stream_id, nice_consensus,
|
get_tags_for_stream_id, nice_consensus,
|
||||||
update_reminder, update_telechat, make_notify_changed_event, get_initial_notify,
|
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.lastcall import request_last_call
|
||||||
from ietf.doc.fields import SearchableDocAliasesField
|
from ietf.doc.fields import SearchableDocAliasesField
|
||||||
from ietf.group.models import Group, Role
|
from ietf.group.models import Group, Role
|
||||||
|
@ -1104,6 +1104,10 @@ def edit_consensus(request, name):
|
||||||
|
|
||||||
e = doc.latest_event(ConsensusDocEvent, type="changed_consensus")
|
e = doc.latest_event(ConsensusDocEvent, type="changed_consensus")
|
||||||
prev_consensus = e and e.consensus
|
prev_consensus = e and e.consensus
|
||||||
|
if (not e):
|
||||||
|
prev_consensus=default_consensus(doc)
|
||||||
|
else:
|
||||||
|
prev_consensus = e and e.consensus
|
||||||
|
|
||||||
if request.method == 'POST':
|
if request.method == 'POST':
|
||||||
form = ConsensusForm(request.POST)
|
form = ConsensusForm(request.POST)
|
||||||
|
@ -1143,7 +1147,7 @@ def request_publication(request, name):
|
||||||
if not is_authorized_in_doc_stream(request.user, doc):
|
if not is_authorized_in_doc_stream(request.user, doc):
|
||||||
return HttpResponseForbidden("You do not have the necessary permissions to view this page")
|
return HttpResponseForbidden("You do not have the necessary permissions to view this page")
|
||||||
|
|
||||||
consensus_event = doc.latest_event(ConsensusDocEvent, type="changed_consensus")
|
# consensus_event = doc.latest_event(ConsensusDocEvent, type="changed_consensus")
|
||||||
|
|
||||||
m = Message()
|
m = Message()
|
||||||
m.frm = request.user.person.formatted_email()
|
m.frm = request.user.person.formatted_email()
|
||||||
|
@ -1214,7 +1218,8 @@ def request_publication(request, name):
|
||||||
doc=doc,
|
doc=doc,
|
||||||
message=m,
|
message=m,
|
||||||
next_state=next_state,
|
next_state=next_state,
|
||||||
consensus_filled_in= ( (consensus_event != None) and (consensus_event.consensus != None) ),
|
# consensus_filled_in= ( (consensus_event != None) and (consensus_event.consensus != None) ),
|
||||||
|
consensus_filled_in= ( True )
|
||||||
),
|
),
|
||||||
context_instance = RequestContext(request))
|
context_instance = RequestContext(request))
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue