Replace old charter branches with new branch based on conversion branch and some preliminary work on generalizing document handling
[[Split portion of a mixed commit.]] - Legacy-Id: 3883.1
This commit is contained in:
parent
f999045c49
commit
328ecb08c3
|
@ -36,7 +36,7 @@ class InternetDraft(Document):
|
|||
#group = models.ForeignKey(Acronym, db_column='group_acronym_id')
|
||||
@property
|
||||
def group(self):
|
||||
from group.proxy import Acronym as AcronymProxy
|
||||
from ietf.group.proxy import Acronym as AcronymProxy
|
||||
g = super(InternetDraft, self).group
|
||||
return AcronymProxy().from_object(g) if g else None
|
||||
#filename = models.CharField(max_length=255, unique=True)
|
||||
|
@ -365,13 +365,13 @@ class InternetDraft(Document):
|
|||
@property
|
||||
def mark_by(self):
|
||||
e = self.latest_event()
|
||||
from person.proxy import IESGLogin as IESGLoginProxy
|
||||
from ietf.person.proxy import IESGLogin as IESGLoginProxy
|
||||
return IESGLoginProxy().from_object(e.by) if e else None
|
||||
|
||||
# job_owner = models.ForeignKey(IESGLogin, db_column='job_owner', related_name='documents')
|
||||
@property
|
||||
def job_owner(self):
|
||||
from person.proxy import IESGLogin as IESGLoginProxy
|
||||
from ietf.person.proxy import IESGLogin as IESGLoginProxy
|
||||
return IESGLoginProxy().from_object(self.ad) if self.ad else None
|
||||
|
||||
#event_date = models.DateField(null=True)
|
||||
|
@ -383,7 +383,7 @@ class InternetDraft(Document):
|
|||
#area_acronym = models.ForeignKey(Area)
|
||||
@property
|
||||
def area_acronym(self):
|
||||
from group.proxy import Area
|
||||
from ietf.group.proxy import Area
|
||||
g = super(InternetDraft, self).group # be careful with group which is proxied
|
||||
if g and g.type_id != "individ":
|
||||
return Area().from_object(g.parent)
|
||||
|
@ -462,7 +462,7 @@ class InternetDraft(Document):
|
|||
@property
|
||||
def resurrect_requested_by(self):
|
||||
e = self.latest_event(type__in=("requested_resurrect", "completed_resurrect"))
|
||||
from person.proxy import IESGLogin as IESGLoginProxy
|
||||
from ietf.person.proxy import IESGLogin as IESGLoginProxy
|
||||
return IESGLoginProxy().from_object(e.by) if e and e.type == "requested_resurrect" else None
|
||||
|
||||
#approved_in_minute = models.IntegerField(null=True, blank=True)
|
||||
|
@ -522,7 +522,7 @@ class InternetDraft(Document):
|
|||
@property
|
||||
def an_sent_by(self):
|
||||
e = self.latest_event(type="iesg_approved")
|
||||
from person.proxy import IESGLogin as IESGLoginProxy
|
||||
from ietf.person.proxy import IESGLogin as IESGLoginProxy
|
||||
return IESGLoginProxy().from_object(e.by) if e else None
|
||||
|
||||
#defer = models.BooleanField()
|
||||
|
@ -535,7 +535,7 @@ class InternetDraft(Document):
|
|||
@property
|
||||
def defer_by(self):
|
||||
e = self.latest_event(type="changed_document", desc__startswith="State changed to <b>IESG Evaluation - Defer</b>")
|
||||
from person.proxy import IESGLogin as IESGLoginProxy
|
||||
from ietf.person.proxy import IESGLogin as IESGLoginProxy
|
||||
return IESGLoginProxy().from_object(e.by) if e else None
|
||||
|
||||
#defer_date = models.DateField(null=True, blank=True)
|
||||
|
@ -572,7 +572,7 @@ class InternetDraft(Document):
|
|||
# return remarks
|
||||
def active_positions(self):
|
||||
"""Returns a list of dicts, with AD and Position tuples"""
|
||||
from person.proxy import IESGLogin as IESGLoginProxy
|
||||
from ietf.person.proxy import IESGLogin as IESGLoginProxy
|
||||
from ietf.doc.utils import active_ballot_positions
|
||||
|
||||
res = []
|
||||
|
@ -892,7 +892,7 @@ class DraftLikeDocAlias(DocAlias):
|
|||
|
||||
@property
|
||||
def ipr(self):
|
||||
from ipr.models import IprDraftProxy
|
||||
from ietf.ipr.models import IprDraftProxy
|
||||
return IprDraftProxy.objects.filter(doc_alias=self.pk)
|
||||
|
||||
class Meta:
|
||||
|
|
|
@ -138,7 +138,7 @@ class IETFWG(Group):
|
|||
#meeting_scheduled = models.CharField(blank=True, max_length=3)
|
||||
@property
|
||||
def meeting_scheduled(self):
|
||||
from meeting.models import Meeting
|
||||
from ietf.meeting.models import Meeting
|
||||
latest_meeting = Meeting.objects.order_by('-date')[0]
|
||||
return "YES" if self.session_set.filter(meeting=latest_meeting) else "NO"
|
||||
#email_address = models.CharField(blank=True, max_length=60)
|
||||
|
|
|
@ -14,8 +14,8 @@ setup_environ(settings)
|
|||
# script
|
||||
from django.core.serializers import serialize
|
||||
from django.db.models import Q
|
||||
from idtracker.models import *
|
||||
from iesg.models import *
|
||||
from ietf.idtracker.models import *
|
||||
from ietf.iesg.models import *
|
||||
|
||||
def output(name, qs):
|
||||
try:
|
||||
|
|
|
@ -40,10 +40,13 @@ urlpatterns = patterns('',
|
|||
(r'^active/$', views_search.active),
|
||||
(r'^in-last-call/$', views_search.in_last_call),
|
||||
url(r'^ad/(?P<name>[A-Za-z0-9.-]+)/$', views_search.by_ad, name="doc_search_by_ad"),
|
||||
|
||||
url(r'^(?P<name>[A-Za-z0-9.-]+)/((?P<tab>ballot|writeup|history)/)?$', views_doc.document_main, name="doc_view"),
|
||||
|
||||
url(r'^(?P<name>[A-Za-z0-9.-]+)/$', views_doc.document_main, name="doc_view"),
|
||||
url(r'^(?P<name>[A-Za-z0-9.-]+)/history/$', views_doc.document_history),
|
||||
url(r'^(?P<name>[A-Za-z0-9.-]+)/writeup/$', views_doc.document_writeup),
|
||||
url(r'^(?P<name>[A-Za-z0-9.-]+)/ballot/$', views_doc.document_ballot),
|
||||
(r'^(?P<name>[A-Za-z0-9.-]+)/doc.json$', views_doc.document_debug),
|
||||
(r'^(?P<name>[A-Za-z0-9.-]+)/_ballot.data$', views_doc.document_ballot),
|
||||
(r'^(?P<name>[A-Za-z0-9.-]+)/_ballot.data$', views_doc.ballot_html), # why is this url so weird instead of just ballot.html?
|
||||
(r'^(?P<name>[A-Za-z0-9.-]+)/ballot.tsv$', views_doc.ballot_tsv),
|
||||
(r'^(?P<name>[A-Za-z0-9.-]+)/ballot.json$', views_doc.ballot_json),
|
||||
|
||||
|
|
|
@ -51,6 +51,52 @@ from ietf.idrfc.models import RfcIndex, DraftVersions
|
|||
from ietf.idrfc.idrfc_wrapper import BallotWrapper, IdWrapper, RfcWrapper
|
||||
from ietf.ietfworkflows.utils import get_full_info_for_draft
|
||||
|
||||
def render_document_top(request, doc, tab):
|
||||
tabs = []
|
||||
tabs.append(("Document", "document", urlreverse("idrfc.views_doc.document_main", kwargs=dict(name=doc.name))))
|
||||
|
||||
if doc_type == "draft":
|
||||
tabs.append(("IESG Evaluation Record", "ballot", urlreverse("idrfc.views_doc.document_ballot", kwargs=dict(name=doc.name))))
|
||||
elif doc_type == "charter":
|
||||
tabs.append(("IESG Review", "ballot", urlreverse("idrfc.views_doc.document_ballot", kwargs=dict(name=doc.name))))
|
||||
|
||||
tabs.append(("IESG Writeups", "writeup", urlreverse("idrfc.views_doc.document_writeup", kwargs=dict(name=doc.name))))
|
||||
tabs.append(("History", "history", urlreverse("idrfc.views_doc.document_history", kwargs=dict(name=doc.name))))
|
||||
|
||||
return render_to_string("idrfc/document_top.html",
|
||||
dict(doc=doc,
|
||||
tabs=tabs,
|
||||
selected=tab))
|
||||
|
||||
|
||||
def document_main(request, name):
|
||||
if name.startswith("ietf-charter-"):
|
||||
# FIXME: render top
|
||||
# render content
|
||||
# refactor history similarly? or use directly
|
||||
# refactor writeup, generalize on names and links to edit
|
||||
# refactor ballot to have multiple ballot typesiet
|
||||
|
||||
return render_to_response("idrfc/doc_tab_document.html",
|
||||
{'content1':content1,
|
||||
'content2':content2,
|
||||
'doc': doc,
|
||||
'tab': "document",
|
||||
'include_text':include_text(request)},
|
||||
context_instance=RequestContext(request));
|
||||
|
||||
|
||||
return document_main_idrfc(request, name, "document")
|
||||
|
||||
def document_history(request, name):
|
||||
return document_main_idrfc(request, name, "history")
|
||||
|
||||
def document_writeup(request, name):
|
||||
return document_main_idrfc(request, name, "writeup")
|
||||
|
||||
def document_ballot(request, name):
|
||||
return document_main_idrfc(request, name, "ballot")
|
||||
|
||||
def document_debug(request, name):
|
||||
r = re.compile("^rfc([1-9][0-9]*)$")
|
||||
m = r.match(name)
|
||||
|
@ -114,9 +160,7 @@ def document_main_rfc(request, rfc_number, tab):
|
|||
context_instance=RequestContext(request));
|
||||
|
||||
@decorator_from_middleware(GZipMiddleware)
|
||||
def document_main(request, name, tab):
|
||||
if tab is None:
|
||||
tab = "document"
|
||||
def document_main_idrfc(request, name, tab):
|
||||
r = re.compile("^rfc([1-9][0-9]*)$")
|
||||
m = r.match(name)
|
||||
if m:
|
||||
|
@ -288,7 +332,7 @@ def get_ballot(name):
|
|||
ballot = BallotWrapper(id)
|
||||
return ballot, doc
|
||||
|
||||
def document_ballot(request, name):
|
||||
def ballot_html(request, name):
|
||||
ballot, doc = get_ballot(name)
|
||||
return render_to_response('idrfc/doc_ballot.html', {'ballot':ballot, 'doc':doc}, context_instance=RequestContext(request))
|
||||
|
||||
|
@ -301,3 +345,4 @@ def ballot_json(request, name):
|
|||
response = HttpResponse(mimetype='text/plain')
|
||||
response.write(json.dumps(ballot.dict(), indent=2))
|
||||
return response
|
||||
|
||||
|
|
|
@ -33,6 +33,9 @@
|
|||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
import codecs, re, os, glob
|
||||
import datetime
|
||||
import tarfile
|
||||
|
||||
from ietf.idtracker.models import IDInternal, InternetDraft,AreaGroup, Position, IESGLogin, Acronym
|
||||
from django.views.generic.list_detail import object_list
|
||||
from django.views.generic.simple import direct_to_template
|
||||
|
@ -50,8 +53,8 @@ from ietf.idrfc.utils import update_telechat
|
|||
from ietf.ietfauth.decorators import group_required
|
||||
from ietf.idtracker.templatetags.ietf_filters import in_group
|
||||
from ietf.ipr.models import IprRfc, IprDraft, IprDetail
|
||||
import datetime
|
||||
import tarfile
|
||||
from redesign.doc.models import TelechatDocEvent
|
||||
from redesign.group.models import Group
|
||||
|
||||
def date_threshold():
|
||||
"""Return the first day of the month that is 185 days ago."""
|
||||
|
@ -208,6 +211,23 @@ def get_doc_sectionREDESIGN(id):
|
|||
s = s + "1"
|
||||
return s
|
||||
|
||||
def get_wg_section(wg):
|
||||
s = ""
|
||||
charter_slug = None
|
||||
if wg.charter:
|
||||
charter_slug = wg.charter.get_state_slug()
|
||||
if wg.state_id == "proposed":
|
||||
if charter_slug == "intrev":
|
||||
s = '411'
|
||||
elif charter_slug == "iesgrev":
|
||||
s = '412'
|
||||
elif wg.state_id == "active":
|
||||
if charter_slug == "intrev":
|
||||
s = '421'
|
||||
elif charter_slug == "iesgrev":
|
||||
s = '422'
|
||||
return s
|
||||
|
||||
if settings.USE_DB_REDESIGN_PROXY_CLASSES:
|
||||
get_doc_section = get_doc_sectionREDESIGN
|
||||
|
||||
|
@ -253,15 +273,14 @@ def agenda_docs(date, next_agenda):
|
|||
return res
|
||||
|
||||
def agenda_wg_actions(date):
|
||||
mapping = {12:'411', 13:'412',22:'421',23:'422'}
|
||||
matches = WGAction.objects.filter(agenda=1,telechat_date=date,category__in=mapping.keys()).order_by('category')
|
||||
res = {}
|
||||
for o in matches:
|
||||
section_key = "s"+mapping[o.category]
|
||||
matches = Group.objects.filter(charter__docevent__telechatdocevent__telechat_date=date)
|
||||
|
||||
res = dict(("s%s%s%s" % (i, j, k), []) for i in range(2, 5) for j in range (1, 4) for k in range(1, 4))
|
||||
for wg in matches:
|
||||
section_key = "s" + get_wg_section(wg)
|
||||
if section_key not in res:
|
||||
res[section_key] = []
|
||||
area = AreaGroup.objects.get(group=o.group_acronym)
|
||||
res[section_key].append({'obj':o, 'area':str(area.area)})
|
||||
res[section_key].append({'obj':wg})
|
||||
return res
|
||||
|
||||
def agenda_management_issues(date):
|
||||
|
|
|
@ -18,5 +18,4 @@ urlpatterns += patterns('ietf.ietfauth.views',
|
|||
url(r'^reset/$', 'password_reset_view', name='password_reset'),
|
||||
url(r'^reset/confirm/(?P<username>[\w.@+-]+)/(?P<date>[\d]+)/(?P<realm>[\w]+)/(?P<reset_hash>[a-f0-9]+)/$', 'confirm_password_reset', name='confirm_password_reset'),
|
||||
url(r'^ajax/check_username/$', 'ajax_check_username', name='ajax_check_username'),
|
||||
|
||||
)
|
||||
|
|
|
@ -49,7 +49,7 @@ def list_drafts(request):
|
|||
mimetype="text/plain")
|
||||
|
||||
def list_draftsREDESIGN(request):
|
||||
from ipr.models import IprDocAlias
|
||||
from ietf.ipr.models import IprDocAlias
|
||||
|
||||
docipr = {}
|
||||
|
||||
|
|
|
@ -65,7 +65,7 @@ IETF.user_groups = {{ user|user_roles_json }};
|
|||
<div id="ietf-login" class="noprint">{% if user.is_authenticated %}
|
||||
{{ user }}
|
||||
{% else %}
|
||||
<a href="https://datatracker.ietf.org/accounts/login/?next={{request.get_full_path|urlencode}}" rel="nofollow">Sign In</a>
|
||||
<a href="https://{{ request.get_host }}/accounts/login/?next={{request.get_full_path|urlencode}}" rel="nofollow">Sign In</a>
|
||||
{% endif %}</div>
|
||||
{% endif %}
|
||||
|
||||
|
|
|
@ -42,11 +42,13 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
<li><a href="{% url doc_search_by_ad name=user.get_profile.person.full_name_as_key %}">My Documents</a></li>
|
||||
<li><a href="{% url ietf.iesg.views.agenda_documents %}">Next Telechat</a></li>
|
||||
<li><a href="{% url ietf.iesg.views.discusses %}">Discusses</a></li>
|
||||
<li><a href="{% url ietf.iesg.views.working_group_actions %}">Working Groups</a></li>
|
||||
{# FIXME: wgcharter <li><a href="{% url wg_search_by_area name=user|ad_area %}">Working Groups</a></li> #}
|
||||
{% endif %}
|
||||
{% if user|in_group:"Secretariat" %}
|
||||
<li class="sect first">Secretariat</li>
|
||||
<li><a href="{% url ietf.iesg.views.telechat_dates %}">Telechat Dates</a></li>
|
||||
<li><a href="{% url ietf.iesg.views.working_group_actions %}">Working Groups</a></li>
|
||||
{# FIXME: wgcharter <li><a href="{% url wg_search_in_process %}">Working Groups</a></li> #}
|
||||
{% endif %}
|
||||
{% if user %}
|
||||
|
|
|
@ -43,20 +43,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
{% endif %}
|
||||
|
||||
<tr>
|
||||
<td>{{wg.area|upper}}</td>
|
||||
<td>{{ wg.obj.status_date|date:"M d"}}</td>
|
||||
<td>{{wg.obj.parent.name|upper}}</td>
|
||||
<td>{{ wg.obj.time|date:"M d"}}</td>
|
||||
<td>
|
||||
<a href="http://www.ietf.org/iesg/evaluation/{{wg.obj.group_acronym}}-charter.txt">
|
||||
{{ wg.obj.group_acronym.name|escape }} ({{wg.obj.group_acronym}})
|
||||
<a href="http://www.ietf.org/iesg/evaluation/charter-ietf-{{wg.obj.acronym}}-{{wg.obj.charter.rev}}.txt">
|
||||
{{ wg.obj.name|escape }} ({{wg.obj.acronym}})
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% if wg.obj.token_name %}
|
||||
<tr><td></td><td>Token:</td><td>{{ wg.obj.token_name|escape }}</td></tr>
|
||||
{% endif %}
|
||||
{% if wg.obj.note %}
|
||||
<tr><td></td><td></td><td>Note: {{wg.obj.note|escape}}</td></tr>
|
||||
{% endif %}
|
||||
|
||||
{% if forloop.last %}
|
||||
</table>
|
||||
|
|
|
@ -35,11 +35,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
{{ title2 }}
|
||||
{% endif %}{{ title3 }}
|
||||
{% for wg in section_wgs %}
|
||||
o {{ wg.obj.group_acronym.name }} ({{wg.obj.group_acronym}})
|
||||
{% if wg.obj.token_name %} Token: {{ wg.obj.token_name }}
|
||||
{% endif %}
|
||||
{% if wg.obj.note %} {% filter wordwrap:"68"|indent|indent %}Note: {{wg.obj.note|striptags}}{% endfilter %}
|
||||
{% endif %}
|
||||
o {{ wg.obj.name }} ({{wg.obj.acronym}})
|
||||
{% empty %}
|
||||
NONE
|
||||
{% endfor %}
|
||||
|
|
|
@ -36,14 +36,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
{{ title2 }}<br>
|
||||
{{ title3 }} ({{ forloop.counter }} of {{ section_wgs|length }})</h3>
|
||||
|
||||
<p><b>{{ wg.obj.group_acronym.name }} ({{wg.obj.group_acronym}})<br>
|
||||
{% if wg.obj.token_name %}
|
||||
Token: {{ wg.obj.token_name }}
|
||||
{% endif %}</b></p>
|
||||
|
||||
{% if wg.obj.note %}
|
||||
<p>Note: {{wg.obj.note|striptags}}</p>
|
||||
{% endif %}
|
||||
<p><b>{{ wg.obj.name }} ({{wg.obj.acronym}})<br>
|
||||
|
||||
{% if title3|startswith:"4.1.1" %}
|
||||
<p>Does anyone have an objection to the charter being sent for
|
||||
|
|
|
@ -21,8 +21,7 @@ Copyright The IETF Trust 2011, All Rights Reserved
|
|||
{% if user|in_group:"Area_Director,Secretariat" %}
|
||||
{% if not snapshot %}
|
||||
<div style="padding-bottom:2px;">
|
||||
{% ifnotequal wg.charter.get_state_slug "notrev" %}
|
||||
{% ifnotequal wg.charter.get_state_slug "approved" %}
|
||||
{% if wg.charter.get_state_slug != "notrev" and wg.charter.get_state_slug != "approved" %}
|
||||
<span id="wg_edit_state_button" class="yui-button yui-link-button" style="margin-left:2px;"><span class="first-child"><a href="{% url wg_startstop_process name=wg.acronym option='abandon' %}">Abandon effort</a></span></span>
|
||||
<span id="wg_edit_state_button" class="yui-button yui-link-button" style="margin-left:2px;"><span class="first-child"><a href="{% url wg_change_state name=wg.acronym %}">Change state</a></span></span>
|
||||
{% ifnotequal wg.state_id "conclude" %}
|
||||
|
@ -30,19 +29,7 @@ Copyright The IETF Trust 2011, All Rights Reserved
|
|||
{% endifnotequal %}
|
||||
{% else %}
|
||||
<span id="wg_edit_state_button" class="yui-button yui-link-button" style="margin-left:2px;"><span class="first-child"><a href="{% url wg_startstop_process name=wg.acronym option='recharter' %}">Recharter</a></span></span>
|
||||
{% endifnotequal %}
|
||||
{% else %}
|
||||
<span id="wg_edit_state_button" class="yui-button yui-link-button" style="margin-left:2px;"><span class="first-child"><a href="{% url wg_startstop_process name=wg.acronym option='recharter' %}">Recharter</a></span></span>
|
||||
{% endifnotequal %}
|
||||
|
||||
{% ifequal wg.state_id "active" %}{% ifequal wg.charter.get_state_slug "approved" %}
|
||||
<span id="wg_conclude_button" class="yui-button yui-link-button" style="margin-left:2px;"><span class="first-child"><a href="{% url wg_conclude name=wg.acronym %}">Conclude WG</a></span></span>
|
||||
{% endifequal %}{% endifequal %}
|
||||
|
||||
{% ifnotequal wg.state_id "conclude" %}
|
||||
<span id="wg_edit_info_button" class="yui-button yui-link-button" style="margin-left:2px;"><span class="first-child"><a href="{% url wg_edit_info name=wg.acronym %}">Edit WG</a></span></span>
|
||||
{% endifnotequal %}
|
||||
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
{% endif %}{# if not snapshot #}
|
||||
|
|
|
@ -35,7 +35,7 @@ Snapshots: {% for d in versions reversed %}{% if forloop.first %}<strong>{% ifno
|
|||
<tr><td colspan='2'><hr size='1' noshade /></td></tr>
|
||||
|
||||
<tr><td>WG State:</td><td> {{ wg.state|safe }} </td>
|
||||
{% ifnotequal wg.state_id "conclude" %}<tr><td><a href="/wgcharter/help/state/">Charter State</>:</td><td> {{ wg.charter.get_state|safe }} {% ifequal wg.state_id "proposed" %}{% ifnotequal wg.charter.get_state_slug "notrev" %}(Initial Chartering){% endifnotequal %}{% else %}{% ifnotequal wg.charter.get_state_slug "approved" %}(Rechartering){% endifnotequal %}{% endifequal %}</td>{% endifnotequal %}
|
||||
{% ifnotequal wg.state_id "conclude" %}<tr><td><a href="/wgcharter/help/state/">Charter State</a>:</td><td> {{ wg.charter.get_state|safe }} {% ifequal wg.state_id "proposed" %}{% ifnotequal wg.charter.get_state_slug "notrev" %}(Initial Chartering){% endifnotequal %}{% else %}{% ifnotequal wg.charter.get_state_slug "approved" %}(Rechartering){% endifnotequal %}{% endifequal %}</td>{% endifnotequal %}
|
||||
{% ifequal wg.state_id "proposed" %}
|
||||
{% if wg.comments %}
|
||||
<tr><td>Reason for chartering:</td><td>{{ wg.comments }}</td></tr>
|
||||
|
|
|
@ -36,80 +36,110 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
{% block wg_titledetail %}Charter{% endblock %}
|
||||
|
||||
{% block wg_content %}
|
||||
|
||||
<div class="ietf-box ietf-wg-details">
|
||||
{% if concluded %}
|
||||
<span class="ietf-concluded-warning">Note: The data for concluded WGs
|
||||
is occasionally incorrect.</span>
|
||||
{% endif %}
|
||||
<table>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<b>Personnel</b>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><th colspan="2">Group</th></tr>
|
||||
|
||||
<tr valign="top">
|
||||
<td style="width:14ex;">Chair{{ wg.chairs|pluralize }}:</td>
|
||||
<td>
|
||||
{% for chair in wg.chairs %}
|
||||
<a href="mailto:{{ chair.address }}">{{ chair.person.name }} <{{ chair.address }}></a><br/>
|
||||
{% endfor %}
|
||||
</td></tr>
|
||||
<tr><td>Area Director:</td>
|
||||
<td>
|
||||
{% if not wg.ad %}?{% else %}
|
||||
<a href="mailto:{{ wg.areadirector.address }}">{{ wg.ad.name }} <{{ wg.areadirector.address }}></a>{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% if wg.techadvisors %}
|
||||
<tr>
|
||||
<td>Tech Advisor{{ wg.techadvisors|pluralize }}:</td>
|
||||
<td>
|
||||
{% for techadvisor in wg.techadvisors %}
|
||||
<a href="mailto:{{ techadvisor.address }}">{{ techadvisor.person.name }} <{{ techadvisor.address }}></a><br/>
|
||||
{% endfor %}
|
||||
</td></tr>
|
||||
{% endif %}
|
||||
{% if wg.editors %}
|
||||
<td>Editor{{ wg.editors|pluralize }}:</td>
|
||||
<td>
|
||||
{% for editor in wg.editors %}
|
||||
<a href="mailto:{{ editor.address }}">{{ editor.person.name }} <{{ editor.address }}></a><br/>
|
||||
{% endfor %}
|
||||
</td></tr>
|
||||
{% endif %}
|
||||
{% if wg.secretaries %}
|
||||
<tr><td>Secretar{{ wg.secretaries|pluralize:"y,ies" }}:</td>
|
||||
<td>
|
||||
{% for secretary in wg.secretaries %}
|
||||
<a href="mailto:{{ secretary.address }}">{{ secretary.person.name }} <{{ secretary.address }}></a><br/>
|
||||
{% endfor %}
|
||||
</td></tr>
|
||||
{% endif %}
|
||||
<tr valign="top">
|
||||
<td style="width:14ex;">Name:</td>
|
||||
<td>{{ wg.name }}</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<br/><b>Mailing List</b>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td>Acronym:</td><td>{{ wg.acronym }}</td></tr>
|
||||
|
||||
<tr><td>Address:</td><td>{{ wg.email_address|urlize }}</td></tr>
|
||||
<tr><td>To Subscribe:</td><td>{{ wg.email_subscribe|urlize }}</td></tr>
|
||||
<tr><td>Archive:</td><td>{{ wg.clean_email_archive|urlize }}</td></tr>
|
||||
{% if wg.parent %}
|
||||
<tr><td>Area:</td><td>{{ wg.parent.name }} ({{ wg.parent.acronym }})</td></tr>
|
||||
{% endif %}
|
||||
|
||||
{% if not concluded %}
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<br/><b>Jabber Chat</b>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td>State:</td><td>{{ wg.state.name }}</td></tr>
|
||||
|
||||
<tr><td>Room Address:</td><td><a href="xmpp:{{wg}}@jabber.ietf.org">xmpp:{{wg}}@jabber.ietf.org</a></td></tr>
|
||||
<tr><td>Logs:</td><td><a href="http://jabber.ietf.org/logs/{{wg}}/">http://jabber.ietf.org/logs/{{wg}}/</a></td></tr>
|
||||
{% endif %}
|
||||
<tr>
|
||||
<td>Charter:</td>
|
||||
<td>
|
||||
{% if wg.charter %}
|
||||
<a href="{% url wgcharter.views.wg_main name=wg.acronym %}">{{ wg.charter.name }}-{{ wg.charter.rev }}</a> ({{ wg.charter.get_state.name }})
|
||||
{% else %}
|
||||
none
|
||||
{% if user|has_role:"Area Director,Secretariat" %}
|
||||
- <a href="{% url wgcharter.views_submit.submit name=wg.acronym %}">Submit Charter</a>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr><th colspan="2">Personnel</th></tr>
|
||||
|
||||
<tr valign="top">
|
||||
<td>Chair{{ wg.chairs|pluralize }}:</td>
|
||||
<td>
|
||||
{% for chair in wg.chairs %}
|
||||
<a href="mailto:{{ chair.address }}">{{ chair.person.plain_name }} <{{ chair.address }}></a><br/>
|
||||
{% endfor %}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr><td>Area Director:</td>
|
||||
<td>
|
||||
{% if not wg.ad %}?{% else %}
|
||||
<a href="mailto:{{ wg.areadirector.address }}">{{ wg.ad.plain_name }} <{{ wg.areadirector.address }}></a>{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% if wg.techadvisors %}
|
||||
<tr>
|
||||
<td>Tech Advisor{{ wg.techadvisors|pluralize }}:</td>
|
||||
<td>
|
||||
{% for techadvisor in wg.techadvisors %}
|
||||
<a href="mailto:{{ techadvisor.address }}">{{ techadvisor.person.plain_name }} <{{ techadvisor.address }}></a><br/>
|
||||
{% endfor %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% if wg.editors %}
|
||||
<td>Editor{{ wg.editors|pluralize }}:</td>
|
||||
<td>
|
||||
{% for editor in wg.editors %}
|
||||
<a href="mailto:{{ editor.address }}">{{ editor.person.plain_name }} <{{ editor.address }}></a><br/>
|
||||
{% endfor %}
|
||||
</td></tr>
|
||||
{% endif %}
|
||||
{% if wg.secretaries %}
|
||||
<tr>
|
||||
<td>Secretar{{ wg.secretaries|pluralize:"y,ies" }}:</td>
|
||||
<td>
|
||||
{% for secretary in wg.secretaries %}
|
||||
<a href="mailto:{{ secretary.address }}">{{ secretary.person.plain_name }} <{{ secretary.address }}></a><br/>
|
||||
{% endfor %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
|
||||
<tr><th colspan="2">Mailing List</th></tr>
|
||||
|
||||
<tr><td>Address:</td><td>{{ wg.email_address|urlize }}</td></tr>
|
||||
<tr><td>To Subscribe:</td><td>{{ wg.email_subscribe|urlize }}</td></tr>
|
||||
<tr><td>Archive:</td><td>{{ wg.clean_email_archive|urlize }}</td></tr>
|
||||
|
||||
{% if not concluded %}
|
||||
<tr><th colspan="2">Jabber Chat</th></tr>
|
||||
|
||||
<tr><td>Room Address:</td><td><a href="xmpp:{{ wg.acronym }}@jabber.ietf.org">xmpp:{{ wg.acronym }}@jabber.ietf.org</a></td></tr>
|
||||
<tr><td>Logs:</td><td><a href="http://jabber.ietf.org/logs/{{ wg.acronym }}/">http://jabber.ietf.org/logs/{{ wg.acronym }}/</a></td></tr>
|
||||
{% endif %}
|
||||
|
||||
</table>
|
||||
|
||||
{% if user|has_role:"Area Director,Secretariat" %}
|
||||
<div style="margin: 2px; margin-top: 2em;">
|
||||
{% for name, url in actions %}
|
||||
<a href="{{ url }}">{{ name }}</a>
|
||||
{% if not forloop.last %}|{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{% if wg.additional_urls %}
|
||||
|
|
|
@ -21,6 +21,7 @@ from ietf.wgcharter.utils import *
|
|||
from ietf.utils.history import find_history_active_at
|
||||
from ietf.idtracker.templatetags.ietf_filters import format_textarea, fill
|
||||
|
||||
# FIXME: delete
|
||||
def _get_html(key, filename):
|
||||
f = None
|
||||
try:
|
||||
|
@ -70,13 +71,13 @@ def wg_main(request, name, rev, tab):
|
|||
prev_list_archive = list(set([x.list_archive for x in wg.history_set.exclude(list_archive=wg.list_archive) if x.list_archive != u'']))
|
||||
if prev_list_archive != [u'']:
|
||||
info['prev_list_archive'] = prev_list_archive
|
||||
info['chairs'] = [x.email.person.name for x in wg.role_set.filter(name__slug="chair")]
|
||||
info['chairs'] = [x.person.plain_name() for x in wg.role_set.filter(name__slug="chair")]
|
||||
if hasattr(gh, 'rolehistory_set'):
|
||||
info['history_chairs'] = [x.email.person.name for x in gh.rolehistory_set.filter(name__slug="chair")]
|
||||
info['history_chairs'] = [x.person.plain_name() for x in gh.rolehistory_set.filter(name__slug="chair")]
|
||||
else:
|
||||
info['history_chairs'] = [x.email.person.name for x in gh.role_set.filter(name__slug="chair")]
|
||||
info['secr'] = [x.email.person.name for x in wg.role_set.filter(name__slug="secr")]
|
||||
info['techadv'] = [x.email.person.name for x in wg.role_set.filter(name__slug="techadv")]
|
||||
info['history_chairs'] = [x.person.plain_name() for x in gh.role_set.filter(name__slug="chair")]
|
||||
info['secr'] = [x.person.plain_name() for x in wg.role_set.filter(name__slug="secr")]
|
||||
info['techadv'] = [x.person.plain_name() for x in wg.role_set.filter(name__slug="techadv")]
|
||||
|
||||
if ch:
|
||||
file_path = wg.charter.get_file_path() # Get from wg.charter
|
||||
|
@ -153,7 +154,7 @@ def _get_history(wg, versions=None):
|
|||
charter_history = find_history_active_at(wg.charter, e.time)
|
||||
info['version'] = charter_history.rev if charter_history else wg.charter.rev
|
||||
info['text'] = e.desc
|
||||
info['by'] = e.by.name
|
||||
info['by'] = e.by.plain_name()
|
||||
info['textSnippet'] = truncatewords_html(format_textarea(fill(info['text'], 80)), 25)
|
||||
info['snipped'] = info['textSnippet'][-3:] == "..."
|
||||
if e.type == "new_revision":
|
||||
|
|
|
@ -32,10 +32,10 @@ def default_action_text(wg, charter, user, action):
|
|||
e.desc = "WG action text was changed"
|
||||
|
||||
info = {}
|
||||
info['chairs'] = [{ 'name': x.email.person.name, 'email': x.email.address} for x in wg.role_set.filter(name="Chair")]
|
||||
info['secr'] = [{ 'name': x.email.person.name, 'email': x.email.address} for x in wg.role_set.filter(name="Secr")]
|
||||
info['techadv'] = [{ 'name': x.email.person.name, 'email': x.email.address} for x in wg.role_set.filter(name="Techadv")]
|
||||
info['ad'] = {'name': wg.ad.name, 'email': wg.ad.email_address().address } if wg.ad else None,
|
||||
info['chairs'] = [{ 'name': x.person.plain_name(), 'email': x.email.address} for x in wg.role_set.filter(name="Chair")]
|
||||
info['secr'] = [{ 'name': x.person.plain_name(), 'email': x.email.address} for x in wg.role_set.filter(name="Secr")]
|
||||
info['techadv'] = [{ 'name': x.person.plain_name(), 'email': x.email.address} for x in wg.role_set.filter(name="Techadv")]
|
||||
info['ad'] = {'name': wg.ad.plain_name(), 'email': wg.ad.role_email("ad").address } if wg.ad else None,
|
||||
info['list'] = wg.list_email if wg.list_email else None,
|
||||
info['list_subscribe'] = str(wg.list_subscribe) if wg.list_subscribe else None,
|
||||
info['list_archive'] = str(wg.list_archive) if wg.list_archive else None,
|
||||
|
@ -64,10 +64,10 @@ def default_review_text(wg, charter, user):
|
|||
e.type = "changed_review_announcement"
|
||||
e.desc = "WG review text was changed"
|
||||
info = {}
|
||||
info['chairs'] = [{ 'name': x.person.name, 'email': x.email.address} for x in wg.role_set.filter(name="Chair")]
|
||||
info['secr'] = [{ 'name': x.person.name, 'email': x.email.address} for x in wg.role_set.filter(name="Secr")]
|
||||
info['techadv'] = [{ 'name': x.person.name, 'email': x.email.address} for x in wg.role_set.filter(name="Techadv")]
|
||||
info['ad'] = {'name': wg.ad.name, 'email': wg.ad.role_email("ad").address } if wg.ad else None,
|
||||
info['chairs'] = [{ 'name': x.person.plain_name(), 'email': x.email.address} for x in wg.role_set.filter(name="Chair")]
|
||||
info['secr'] = [{ 'name': x.person.plain_name(), 'email': x.email.address} for x in wg.role_set.filter(name="Secr")]
|
||||
info['techadv'] = [{ 'name': x.person.plain_name(), 'email': x.email.address} for x in wg.role_set.filter(name="Techadv")]
|
||||
info['ad'] = {'name': wg.ad.plain_name(), 'email': wg.ad.role_email("ad").address } if wg.ad else None,
|
||||
info['list'] = wg.list_email if wg.list_email else None,
|
||||
info['list_subscribe'] = wg.list_subscribe if wg.list_subscribe else None,
|
||||
info['list_archive'] = wg.list_archive if wg.list_archive else None,
|
||||
|
@ -205,15 +205,15 @@ def edit_position(request, name):
|
|||
if not old_pos and pos.pos.slug != "norecord":
|
||||
pos.desc = u"[Ballot Position Update] New position, %s, has been recorded for %s" % (pos.pos.name, pos.ad.name)
|
||||
elif old_pos and pos.pos != old_pos.pos:
|
||||
pos.desc = "[Ballot Position Update] Position for %s has been changed to %s from %s" % (pos.ad.name, pos.pos.name, old_pos.pos.name)
|
||||
pos.desc = "[Ballot Position Update] Position for %s has been changed to %s from %s" % (pos.ad.plain_name(), pos.pos.name, old_pos.pos.name)
|
||||
|
||||
if not pos.desc and changes:
|
||||
pos.desc = u"Ballot %s text updated for %s" % (u" and ".join(changes), ad.name)
|
||||
pos.desc = u"Ballot %s text updated for %s" % (u" and ".join(changes), ad.plain_name())
|
||||
|
||||
# only add new event if we actually got a change
|
||||
if pos.desc:
|
||||
if login != ad:
|
||||
pos.desc += u" by %s" % login.name
|
||||
pos.desc += u" by %s" % login.plain_name()
|
||||
|
||||
pos.save()
|
||||
|
||||
|
@ -302,13 +302,13 @@ def send_ballot_comment(request, name):
|
|||
c = pos.comment
|
||||
subj.append("COMMENT")
|
||||
|
||||
ad_name_genitive = ad.name + "'" if ad.name.endswith('s') else ad.name + "'s"
|
||||
ad_name_genitive = ad.plain_name() + "'" if ad.plain_name().endswith('s') else ad.plain_name() + "'s"
|
||||
subject = "%s %s on %s" % (ad_name_genitive, pos.pos.name if pos.pos else "No Position", charter.name + "-" + charter.rev)
|
||||
if subj:
|
||||
subject += ": (with %s)" % " and ".join(subj)
|
||||
|
||||
body = render_to_string("wgcharter/ballot_comment_mail.txt",
|
||||
dict(block_comment=d, comment=c, ad=ad.name, charter=charter, pos=pos.pos))
|
||||
dict(block_comment=d, comment=c, ad=ad.plain_name(), charter=charter, pos=pos.pos))
|
||||
frm = ad.formatted_email()
|
||||
to = "The IESG <iesg@ietf.org>"
|
||||
|
||||
|
@ -467,7 +467,7 @@ def ballot_writeupnotes(request, name):
|
|||
pos.type = "changed_ballot_position"
|
||||
pos.ad = login
|
||||
pos.pos_id = "yes"
|
||||
pos.desc = "[Ballot Position Update] New position, %s, has been recorded for %s" % (pos.pos.name, pos.ad.name)
|
||||
pos.desc = "[Ballot Position Update] New position, %s, has been recorded for %s" % (pos.pos.name, pos.ad.plain_name())
|
||||
pos.save()
|
||||
|
||||
msg = generate_issue_ballot_mail(request, charter)
|
||||
|
@ -476,7 +476,7 @@ def ballot_writeupnotes(request, name):
|
|||
e = DocEvent(doc=charter, by=login)
|
||||
e.by = login
|
||||
e.type = "sent_ballot_announcement"
|
||||
e.desc = "Ballot has been issued by %s" % login.name
|
||||
e.desc = "Ballot has been issued"
|
||||
e.save()
|
||||
|
||||
return render_to_response('wgcharter/ballot_issued.html',
|
||||
|
|
|
@ -36,6 +36,7 @@ from django.shortcuts import get_object_or_404, render_to_response
|
|||
from django.template import RequestContext, loader
|
||||
from django.http import HttpResponse
|
||||
from django.conf import settings
|
||||
from django.core.urlresolvers import reverse as urlreverse
|
||||
from ietf.idtracker.models import Area, IETFWG
|
||||
from ietf.idrfc.views_search import SearchForm, search_query
|
||||
from ietf.idrfc.idrfc_wrapper import IdRfcWrapper
|
||||
|
@ -149,17 +150,25 @@ def wg_charter(request, acronym):
|
|||
|
||||
if settings.USE_DB_REDESIGN_PROXY_CLASSES:
|
||||
fill_in_charter_info(wg)
|
||||
actions = []
|
||||
if wg.state_id != "conclude":
|
||||
actions.append(("Edit WG", urlreverse("wg_edit_info", kwargs=dict(name=wg.acronym))))
|
||||
|
||||
if wg.state_id == "active" and (not wg.charter or wg.charter.get_state_slug() == "approved"):
|
||||
actions.append(("Conclude WG", urlreverse("wg_conclude", kwargs=dict(name=wg.acronym))))
|
||||
|
||||
context = get_wg_menu_context(wg, "charter")
|
||||
context.update(dict(
|
||||
actions=actions))
|
||||
|
||||
return render_to_response('wginfo/wg_charterREDESIGN.html',
|
||||
dict(wg=wg,
|
||||
concluded=concluded,
|
||||
proposed=proposed,
|
||||
selected='charter'),
|
||||
context,
|
||||
RequestContext(request))
|
||||
|
||||
return render_to_response('wginfo/wg_charter.html', {'wg': wg, 'concluded':concluded, 'proposed': proposed, 'selected':'charter'}, RequestContext(request))
|
||||
|
||||
def get_wg_menu_context(wg, selected):
|
||||
# it would probably be better to refactor this file into rendering
|
||||
# it would probably be better to refactor wginfo into rendering
|
||||
# the menu separately instead of each view having to include the information
|
||||
|
||||
return dict(wg=wg, concluded=wg.state_id == "conclude", proposed=wg.state_id == "proposed", selected=selected)
|
||||
|
|
|
@ -27,9 +27,12 @@ from ietf.wgchairs.models import ProtoWriteUp
|
|||
|
||||
from workflows.models import State as StateOld
|
||||
|
||||
document_name_to_import = None
|
||||
import_docs_from = document_name_to_import = None
|
||||
if len(sys.argv) > 1:
|
||||
document_name_to_import = sys.argv[1]
|
||||
try:
|
||||
import_docs_from = datetime.datetime.strptime(sys.argv[1], "%Y-%m-%d")
|
||||
except:
|
||||
document_name_to_import = sys.argv[1]
|
||||
|
||||
dont_save_queries()
|
||||
|
||||
|
@ -225,6 +228,8 @@ def iesg_login_is_secretary(l):
|
|||
# Amy has two users, for some reason, we sometimes get the wrong one
|
||||
return l.user_level == IESGLogin.SECRETARIAT_LEVEL or (l.first_name == "Amy" and l.last_name == "Vezza")
|
||||
|
||||
old_internetdraft_content_type_id = ContentType.objects.using("legacy").get(app_label="idtracker", model="internetdraft").pk
|
||||
|
||||
# regexps for parsing document comments
|
||||
|
||||
date_re_str = "(?P<year>[0-9][0-9][0-9][0-9])-(?P<month>[0-9][0-9]?)-(?P<day>[0-9][0-9]?)"
|
||||
|
@ -765,15 +770,15 @@ def import_from_idinternal(d, idinternal):
|
|||
|
||||
|
||||
all_drafts = InternetDraft.objects.all().order_by('pk').select_related()
|
||||
if import_docs_from:
|
||||
all_drafts = all_drafts.filter(last_modified_date__gte=import_docs_from) | all_drafts.filter(idinternal__event_date__gte=import_docs_from)
|
||||
|
||||
if document_name_to_import:
|
||||
if document_name_to_import.startswith("rfc"):
|
||||
all_drafts = all_drafts.filter(rfc_number=document_name_to_import[3:])
|
||||
else:
|
||||
all_drafts = all_drafts.filter(filename=document_name_to_import)
|
||||
#all_drafts = all_drafts[all_drafts.count() - 1000:]
|
||||
#all_drafts = all_drafts.none()
|
||||
|
||||
old_internetdraft_content_type_id = ContentType.objects.using("legacy").get(app_label="idtracker", model="internetdraft").pk
|
||||
|
||||
for index, o in enumerate(all_drafts.iterator()):
|
||||
print "importing", o.id_document_tag, o.filename, index, "ballot %s" % o.idinternal.ballot_id if o.idinternal and o.idinternal.ballot_id else ""
|
||||
|
@ -1093,7 +1098,11 @@ if all_drafts.count() != InternetDraft.objects.count():
|
|||
else:
|
||||
# if we didn't process all drafts, limit the RFCs to the ones we
|
||||
# did process
|
||||
all_rfcs = all_rfcs.filter(rfc_number__in=set(d.rfc_number for d in all_drafts if d.rfc_number))
|
||||
rfc_numbers = set(d.rfc_number for d in all_drafts if d.rfc_number)
|
||||
if import_docs_from:
|
||||
all_rfcs = all_rfcs.filter(rfc_number__in=rfc_numbers) | all_rfcs.filter(rfc_published_date__gte=import_docs_from)
|
||||
else:
|
||||
all_rfcs = all_rfcs.filter(rfc_number__in=rfc_numbers)
|
||||
|
||||
for index, o in enumerate(all_rfcs.iterator()):
|
||||
print "importing rfc%s" % o.rfc_number, index
|
||||
|
|
|
@ -24,6 +24,11 @@ from redesign.importing.utils import old_person_to_person, dont_save_queries
|
|||
from ietf.name.models import *
|
||||
from ietf.name.utils import name
|
||||
|
||||
import_meetings_from = None
|
||||
if len(sys.argv) > 1:
|
||||
import_meetings_from = datetime.datetime.strptime(sys.argv[1], "%Y-%m-%d")
|
||||
|
||||
|
||||
dont_save_queries()
|
||||
|
||||
# imports Meeting, MeetingVenue, MeetingRoom, NonSession,
|
||||
|
@ -294,7 +299,11 @@ def import_materials(wg_meeting_session, session):
|
|||
|
||||
obviously_bogus_date = datetime.date(1970, 1, 1)
|
||||
|
||||
for o in WgMeetingSession.objects.all().order_by("pk").iterator():
|
||||
all_sessions = WgMeetingSession.objects.all().order_by("pk")
|
||||
if import_meetings_from:
|
||||
all_sessions = all_sessions.filter(last_modified_date__gte=import_meetings_from)
|
||||
|
||||
for o in all_sessions.iterator():
|
||||
# num_session is unfortunately not quite reliable, seems to be
|
||||
# right for 1 or 2 but not 3 and it's sometimes null
|
||||
sessions = o.num_session or 1
|
||||
|
|
|
@ -28,6 +28,11 @@ from redesign.importing.utils import *
|
|||
# should probably import
|
||||
# PersonOrOrgInfo/PostalAddress/EmailAddress/PhoneNumber fully
|
||||
|
||||
import_docs_from = None
|
||||
if len(sys.argv) > 1:
|
||||
import_docs_from = datetime.datetime.strptime(sys.argv[1], "%Y-%m-%d")
|
||||
|
||||
|
||||
# make sure special system user/email is created
|
||||
print "creating (System) person and email"
|
||||
try:
|
||||
|
@ -174,7 +179,11 @@ for o in PersonOrOrgInfo.objects.filter(wgproceedingsactivities__id__gte=1).orde
|
|||
email = get_or_create_email(o, create_fake=True)
|
||||
|
||||
# IDAuthor persons
|
||||
for o in IDAuthor.objects.all().order_by('id').select_related('person').iterator():
|
||||
all_authors = IDAuthor.objects.all().order_by('id').select_related('person')
|
||||
if import_docs_from:
|
||||
all_authors = all_authors.filter(document__last_modified_date__gte=import_docs_from)
|
||||
|
||||
for o in all_authors.iterator():
|
||||
print "importing IDAuthor", o.id, o.person_id, o.person.first_name.encode('utf-8'), o.person.last_name.encode('utf-8')
|
||||
email = get_or_create_email(o, create_fake=True)
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@ management.setup_environ(settings)
|
|||
|
||||
from django.db.models import TextField, CharField
|
||||
|
||||
from django.contrib.sites.models import Site
|
||||
from ietf.redirects.models import Redirect, Suffix, Command
|
||||
from ietf.iesg.models import TelechatAgendaItem, WGAction
|
||||
from ietf.ipr.models import IprSelecttype, IprLicensing, IprDetail, IprContact, IprNotification, IprUpdate
|
||||
|
@ -24,10 +25,12 @@ from django.contrib.auth.models import User
|
|||
|
||||
known_models = {
|
||||
'base': [User],
|
||||
'others': [Redirect, Suffix, Command,
|
||||
'others': [Site,
|
||||
Redirect, Suffix, Command,
|
||||
TelechatAgendaItem, WGAction,
|
||||
IprSelecttype, IprLicensing, IprDetail, IprContact, IprNotification, IprUpdate,
|
||||
IdSubmissionStatus, IdSubmissionDetail, IdApprovedDetail, TempIdAuthors]
|
||||
IdSubmissionStatus, IdSubmissionDetail, IdApprovedDetail,
|
||||
TempIdAuthors]
|
||||
}
|
||||
|
||||
models_to_copy = known_models[sys.argv[1]]
|
||||
|
@ -53,7 +56,6 @@ def insert_many_including_pk(objects, using="default", table=None):
|
|||
for o in objects:
|
||||
pars = []
|
||||
for f in fields:
|
||||
#print f.name, f.pre_save(o, True)
|
||||
pars.append(f.get_db_prep_save(f.pre_save(o, True), connection=con))
|
||||
parameters.append(pars)
|
||||
|
||||
|
@ -79,7 +81,12 @@ def clean_chunk(model, chunk):
|
|||
for model in models_to_copy:
|
||||
sys.stdout.write("copying %s " % model._meta.object_name)
|
||||
sys.stdout.flush()
|
||||
table_name = "%s_%s" % (model._meta.app_label, model._meta.object_name.lower())
|
||||
|
||||
irregular_models = [Site]
|
||||
if model in irregular_models:
|
||||
table_name = Site._meta.db_table
|
||||
else:
|
||||
table_name = "%s_%s" % (model._meta.app_label, model._meta.object_name.lower())
|
||||
|
||||
for chunk in queryset_chunks(model.objects.using("legacy").all(), 1000):
|
||||
clean_chunk(model, chunk)
|
||||
|
|
|
@ -221,7 +221,12 @@ for o in IESGLogin.objects.all():
|
|||
if email and o.user_level == IESGLogin.SECRETARIAT_LEVEL:
|
||||
if not Role.objects.filter(name=secretary_role, person=email.person):
|
||||
Role.objects.create(name=secretary_role, group=Group.objects.get(acronym="secretariat"), person=email.person, email=email)
|
||||
|
||||
u = email.person.user
|
||||
if u:
|
||||
u.is_staff = True
|
||||
u.is_superuser = True
|
||||
u.save()
|
||||
|
||||
# AreaDirector
|
||||
for o in AreaDirector.objects.all():
|
||||
if not o.area:
|
||||
|
|
Loading…
Reference in a new issue