From fc88964298f1736d6623f7c2901034f9738f3ad4 Mon Sep 17 00:00:00 2001 From: Ole Laursen Date: Mon, 23 Jan 2012 20:22:45 +0000 Subject: [PATCH] Go through the code and replace uses of Person.name with Person.plain_name() - Legacy-Id: 3849 --- ietf/idrfc/idrfc_wrapper.py | 4 ++-- ietf/idrfc/lastcall.py | 2 +- ietf/idrfc/mails.py | 10 +++++----- ietf/idrfc/templatetags/ballot_icon.py | 2 +- ietf/idrfc/utils.py | 13 ++++++------ ietf/idrfc/views_ballot.py | 20 +++++++++---------- ietf/idrfc/views_doc.py | 2 +- ietf/idrfc/views_edit.py | 2 +- ietf/idrfc/views_search.py | 4 ++-- ietf/ietfworkflows/utils.py | 2 +- ietf/liaisons/accountsREDESIGN.py | 2 +- ietf/liaisons/mails.py | 2 +- .../announcements/nomcomREDESIGN.html | 4 ++-- .../idrfc/edit_positionREDESIGN.html | 4 ++-- ietf/templates/iesg/scribe_doc.html | 4 ++-- ietf/templates/wgcharter/edit_position.html | 4 ++-- ietf/templates/wgcharter/wg_info.txt | 8 ++++---- ietf/templates/wginfo/history.html | 2 +- ietf/templates/wginfo/wg-charterREDESIGN.txt | 6 +++--- ietf/templates/wginfo/wg-dirREDESIGN.html | 4 ++-- ietf/wgchairs/forms.py | 2 +- ietf/wgchairs/tests.py | 6 +++--- ietf/wgcharter/feeds.py | 12 +++++------ ietf/wgcharter/mails.py | 4 ++-- ietf/wgcharter/templatetags/wg_ballot_icon.py | 2 +- ietf/wgcharter/utils.py | 7 +++---- ietf/wgcharter/views_edit.py | 10 +++++----- ietf/wgcharter/views_search.py | 4 ++-- 28 files changed, 73 insertions(+), 75 deletions(-) diff --git a/ietf/idrfc/idrfc_wrapper.py b/ietf/idrfc/idrfc_wrapper.py index 57efaba6c..caba95902 100644 --- a/ietf/idrfc/idrfc_wrapper.py +++ b/ietf/idrfc/idrfc_wrapper.py @@ -735,7 +735,7 @@ class BallotWrapper: for pos in BallotPositionDocEvent.objects.filter(doc=self.ballot, type="changed_ballot_position", time__gte=self.ballot.process_start, time__lte=self.ballot.process_end).select_related('ad').order_by("-time", '-id'): if pos.ad not in seen: - p = dict(ad_name=pos.ad.name, + p = dict(ad_name=pos.ad.plain_name(), ad_username=pos.ad.pk, # ought to rename this in doc_ballot_list position=pos.pos.name, is_old_ad=pos.ad not in active_ads, @@ -775,7 +775,7 @@ class BallotWrapper: if self.ballot_active: for ad in active_ads: if ad not in seen: - d = dict(ad_name=ad.name, + d = dict(ad_name=ad.plain_name(), ad_username=ad.pk, position="No Record", ) diff --git a/ietf/idrfc/lastcall.py b/ietf/idrfc/lastcall.py index cdc7a17e2..11c70ff0d 100644 --- a/ietf/idrfc/lastcall.py +++ b/ietf/idrfc/lastcall.py @@ -34,7 +34,7 @@ def request_last_callREDESIGN(request, doc): e.type = "requested_last_call" e.by = request.user.get_profile() e.doc = doc - e.desc = "Last call was requested by %s" % e.by.name + e.desc = "Last call was requested" e.save() if settings.USE_DB_REDESIGN_PROXY_CLASSES: diff --git a/ietf/idrfc/mails.py b/ietf/idrfc/mails.py index d53512a77..4482346bc 100644 --- a/ietf/idrfc/mails.py +++ b/ietf/idrfc/mails.py @@ -63,7 +63,7 @@ def email_adREDESIGN(request, doc, ad, changed_by, text, subject=None): to = ad.role_email("ad").formatted_email() send_mail(request, to, "DraftTracker Mail System ", - "%s updated by %s" % (doc.file_tag(), changed_by.name), + "%s updated by %s" % (doc.file_tag(), changed_by.plain_name()), "idrfc/change_notice.txt", dict(text=html_to_text(text), doc=doc, @@ -325,9 +325,9 @@ def generate_approval_mail_approved(request, doc): other_director = Person.objects.filter(role__group__role__person=director, role__group__role__name="ad").exclude(pk=director.pk) if doc.group.type_id != "individ" and other_director: - contacts = "The IESG contact persons are %s and %s." % (director.name, other_director[0].name) + contacts = "The IESG contact persons are %s and %s." % (director.plain_name(), other_director[0].plain_name()) else: - contacts = "The IESG contact person is %s." % director.name + contacts = "The IESG contact person is %s." % director.plain_name() doc_type = "RFC" if doc.get_state_slug() == "rfc" else "Internet Draft" @@ -559,7 +559,7 @@ def generate_issue_ballot_mailREDESIGN(request, doc): return "[ ]" fmt = u"%-21s%-10s%-11s%-9s%-10s" % ( - p.ad.name[:21], + p.ad.plain_name()[:21], formatted(p.pos_id == "yes"), formatted(p.pos_id == "noobj"), formatted(p.pos_id == "discuss"), @@ -577,7 +577,7 @@ def generate_issue_ballot_mailREDESIGN(request, doc): active_ad_positions.sort() inactive_ad_positions.sort() - ad_feedback.sort(key=lambda p: p.ad.name) + ad_feedback.sort(key=lambda p: p.ad.plain_name()) e = doc.latest_event(LastCallDocEvent, type="sent_last_call") last_call_expires = e.expires if e else None diff --git a/ietf/idrfc/templatetags/ballot_icon.py b/ietf/idrfc/templatetags/ballot_icon.py index 8a804d435..89ae93392 100644 --- a/ietf/idrfc/templatetags/ballot_icon.py +++ b/ietf/idrfc/templatetags/ballot_icon.py @@ -52,7 +52,7 @@ def get_user_name(context): if settings.USE_DB_REDESIGN_PROXY_CLASSES: from person.models import Person try: - return context['user'].get_profile().name + return context['user'].get_profile().plain_name() except Person.DoesNotExist: return None diff --git a/ietf/idrfc/utils.py b/ietf/idrfc/utils.py index 85f065d44..ea8bdbfbd 100644 --- a/ietf/idrfc/utils.py +++ b/ietf/idrfc/utils.py @@ -164,20 +164,19 @@ def update_telechatREDESIGN(request, doc, by, new_telechat_date, new_returning_i if on_agenda != prev_agenda: if on_agenda: - e.desc = "Placed on agenda for telechat - %s by %s" % ( - new_telechat_date, by.name) + e.desc = "Placed on agenda for telechat - %s" % (new_telechat_date) else: - e.desc = "Removed from agenda for telechat by %s" % by.name + e.desc = "Removed from agenda for telechat" elif on_agenda and new_telechat_date != prev_telechat: - e.desc = "Telechat date has been changed to %s from %s by %s" % ( - new_telechat_date, prev_telechat, by.name) + e.desc = "Telechat date has been changed to %s from %s" % ( + new_telechat_date, prev_telechat) else: # we didn't reschedule but flipped returning item bit - let's # just explain that if returning: - e.desc = "Added as returning item on telechat by %s" % by.name + e.desc = "Added as returning item on telechat" else: - e.desc = "Removed as returning item on telechat by %s" % by.name + e.desc = "Removed as returning item on telechat" e.save() diff --git a/ietf/idrfc/views_ballot.py b/ietf/idrfc/views_ballot.py index b0c603f99..140f24c1d 100644 --- a/ietf/idrfc/views_ballot.py +++ b/ietf/idrfc/views_ballot.py @@ -296,17 +296,17 @@ def edit_positionREDESIGN(request, name): # figure out a description 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) + pos.desc = u"[Ballot Position Update] New position, %s, has been recorded for %s" % (pos.pos.name, pos.ad.plain_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() @@ -468,7 +468,7 @@ def send_ballot_commentREDESIGN(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", doc.name + "-" + doc.rev) if subj: subject += ": (with %s)" % " and ".join(subj) @@ -476,7 +476,7 @@ def send_ballot_commentREDESIGN(request, name): doc.filename = doc.name # compatibility attributes doc.revision_display = doc.rev body = render_to_string("idrfc/ballot_comment_mail.txt", - dict(discuss=d, comment=c, ad=ad.name, doc=doc, pos=pos.pos)) + dict(discuss=d, comment=c, ad=ad.plain_name(), doc=doc, pos=pos.pos)) frm = ad.role_email("ad").formatted_email() to = "The IESG " @@ -568,7 +568,7 @@ def defer_ballotREDESIGN(request, name): email_state_changed(request, doc, e.desc) update_telechat(request, doc, login, telechat_date) - email_ballot_deferred(request, doc, login.name, telechat_date) + email_ballot_deferred(request, doc, login.plain_name(), telechat_date) return HttpResponseRedirect(doc.get_absolute_url()) @@ -957,7 +957,7 @@ def ballot_writeupnotesREDESIGN(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() approval = doc.latest_event(WriteupDocEvent, type="changed_ballot_approval_text") @@ -972,7 +972,7 @@ def ballot_writeupnotesREDESIGN(request, name): e = DocEvent(doc=doc, 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('idrfc/ballot_issued.html', @@ -1358,7 +1358,7 @@ def make_last_callREDESIGN(request, name): e = LastCallDocEvent(doc=doc, by=login) e.type = "sent_last_call" - e.desc = "Last call sent by %s" % login.name + e.desc = "Last call sent" if form.cleaned_data['last_call_sent_date'] != e.time.date(): e.time = datetime.datetime.combine(form.cleaned_data['last_call_sent_date'], e.time.time()) e.expires = form.cleaned_data['last_call_expiration_date'] diff --git a/ietf/idrfc/views_doc.py b/ietf/idrfc/views_doc.py index aa5f1c154..3a622cb1d 100644 --- a/ietf/idrfc/views_doc.py +++ b/ietf/idrfc/views_doc.py @@ -168,7 +168,7 @@ def _get_history(doc, versions): info["dontmolest"] = True 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:] == "..." and e.type != "new_revision" results.append({'comment':e, 'info':info, 'date':e.time, 'is_com':True}) diff --git a/ietf/idrfc/views_edit.py b/ietf/idrfc/views_edit.py index b42ff8350..a88cd2167 100644 --- a/ietf/idrfc/views_edit.py +++ b/ietf/idrfc/views_edit.py @@ -453,7 +453,7 @@ class EditInfoFormREDESIGN(forms.Form): ad_pk = self.initial.get('ad') choices = self.fields['ad'].choices if ad_pk and ad_pk not in [pk for pk, name in choices]: - self.fields['ad'].choices = list(choices) + [("", "-------"), (ad_pk, Person.objects.get(pk=ad_pk).name)] + self.fields['ad'].choices = list(choices) + [("", "-------"), (ad_pk, Person.objects.get(pk=ad_pk).plain_name())] # telechat choices dates = [d.date for d in TelechatDate.objects.active().order_by('date')] diff --git a/ietf/idrfc/views_search.py b/ietf/idrfc/views_search.py index a60f61dc5..907377ec4 100644 --- a/ietf/idrfc/views_search.py +++ b/ietf/idrfc/views_search.py @@ -307,7 +307,7 @@ if settings.USE_DB_REDESIGN_PROXY_CLASSES: active_ads.sort(key=extract_last_name) inactive_ads.sort(key=extract_last_name) - self.fields['ad'].choices = c = [('', 'any AD')] + [(ad.pk, ad.name) for ad in active_ads] + [('', '------------------')] + [(ad.pk, ad.name) for ad in inactive_ads] + 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['subState'].choices = [('', 'any substate'), ('0', 'no substate')] + [(n.slug, n.name) for n in DocTagName.objects.filter(slug__in=('point', 'ad-f-up', 'need-rev', 'extpty'))] def clean_name(self): value = self.cleaned_data.get('name','') @@ -574,7 +574,7 @@ def by_ad(request, name): | Q(pk__in=responsible)): if name == p.full_name_as_key(): ad_id = p.id - ad_name = p.name + ad_name = p.plain_name() break else: for i in IESGLogin.objects.filter(user_level__in=[1,2]): diff --git a/ietf/ietfworkflows/utils.py b/ietf/ietfworkflows/utils.py index d9aca87ed..bed5e8683 100644 --- a/ietf/ietfworkflows/utils.py +++ b/ietf/ietfworkflows/utils.py @@ -244,7 +244,7 @@ def get_notification_receivers(doc, extra_notify): persons = set() res = [] for r in Role.objects.filter(group=doc.group, name__in=("chair", "delegate")): - res.append(u'"%s" <%s>' % (r.person.name, r.email.address)) + res.append(u'"%s" <%s>' % (r.person.plain_name(), r.email.address)) persons.add(r.person) for email in doc.authors.all(): diff --git a/ietf/liaisons/accountsREDESIGN.py b/ietf/liaisons/accountsREDESIGN.py index b43684460..816973138 100644 --- a/ietf/liaisons/accountsREDESIGN.py +++ b/ietf/liaisons/accountsREDESIGN.py @@ -35,7 +35,7 @@ def get_person_for_user(user): return None try: p = user.get_profile() - p.email = lambda: (p.name, p.email_address()) + p.email = lambda: (p.plain_name(), p.email_address()) return p except Person.DoesNotExist: return None diff --git a/ietf/liaisons/mails.py b/ietf/liaisons/mails.py index 0ba8661de..fcc41eac4 100644 --- a/ietf/liaisons/mails.py +++ b/ietf/liaisons/mails.py @@ -73,7 +73,7 @@ def send_sdo_reminder(sdo): subject = 'Request for update of list of authorized individuals' to_email = manager_role.email.address - name = manager_role.person.name + name = manager_role.person.plain_name() authorized_list = role_persons_with_fixed_email(sdo, "auth") body = render_to_string('liaisons/sdo_reminder.txt', dict( diff --git a/ietf/templates/announcements/nomcomREDESIGN.html b/ietf/templates/announcements/nomcomREDESIGN.html index fb32bdb3c..72ef2350e 100644 --- a/ietf/templates/announcements/nomcomREDESIGN.html +++ b/ietf/templates/announcements/nomcomREDESIGN.html @@ -5,14 +5,14 @@

IAB/IESG Nominating Committee

-

Current Committee Chair: {{ curr_chair.person.name }}

+

Current Committee Chair: {{ curr_chair.person.plain_name }}

{% for regime in regimes %}

Messages from {{ regime.group.start_year }} - {{ regime.group.end_year }}

{# use person email address here rather than the generic nomcom-chair@ietf.org #} -

Committee Chair: {{ regime.chair.person.name }}

+

Committee Chair: {{ regime.chair.person.plain_name }}

diff --git a/ietf/templates/idrfc/edit_positionREDESIGN.html b/ietf/templates/idrfc/edit_positionREDESIGN.html index 65c29b8cb..daab1574b 100644 --- a/ietf/templates/idrfc/edit_positionREDESIGN.html +++ b/ietf/templates/idrfc/edit_positionREDESIGN.html @@ -1,6 +1,6 @@ {% extends "base.html" %} -{% block title %}Change position for {{ ad.name }} on {{ doc }}{% endblock %} +{% block title %}Change position for {{ ad.plain_name }} on {{ doc }}{% endblock %} {% block morecss %} div.ballot-deferred { @@ -33,7 +33,7 @@ form.position-form .comment-text { {% endblock %} {% block content %} -

Change position for {{ ad.name }} {{ doc }}

+

Change position for {{ ad.plain_name }} {{ doc }}

{% if ballot_deferred %}
Ballot deferred by {{ ballot_deferred.by }} on {{ ballot_deferred.time|date:"Y-m-d" }}.
diff --git a/ietf/templates/iesg/scribe_doc.html b/ietf/templates/iesg/scribe_doc.html index 2945f6f9c..a92b13841 100644 --- a/ietf/templates/iesg/scribe_doc.html +++ b/ietf/templates/iesg/scribe_doc.html @@ -49,9 +49,9 @@ Some parts Copyright (c) 2009 The IETF Trust, all rights reserved. {% endfor %} {% if doc.obj.ballot.active %}
Discusses/comments (from ballot {{doc.obj.ballot.ballot }}):
    {% if USE_DB_REDESIGN_PROXY_CLASSES %} -{% for p in doc.obj.active_positions|dictsort:"ad.name" %}{% if p.pos %}{% ifequal p.pos.pos_id "discuss" %}
  1. {{ p.pos.ad.name }}: Discuss [{{ p.pos.discuss_time.date }}]: +{% for p in doc.obj.active_positions|dictsort:"ad.plain_name" %}{% if p.pos %}{% ifequal p.pos.pos_id "discuss" %}
  2. {{ p.pos.ad.plain_name }}: Discuss [{{ p.pos.discuss_time.date }}]:
    ... -{% endifequal %}{% if p.pos.comment %}
  3. {{ p.pos.ad.name }}: Comment [{{ p.pos.comment_time.date }}]: +{% endifequal %}{% if p.pos.comment %}
  4. {{ p.pos.ad.plain_name }}: Comment [{{ p.pos.comment_time.date }}]:
    ... {% endif %}{% endif %}{% endfor %} {% else %} diff --git a/ietf/templates/wgcharter/edit_position.html b/ietf/templates/wgcharter/edit_position.html index e9609ef27..daa98284c 100644 --- a/ietf/templates/wgcharter/edit_position.html +++ b/ietf/templates/wgcharter/edit_position.html @@ -1,6 +1,6 @@ {% extends "base.html" %} -{% block title %}Change position for {{ ad.name }} on {{ wg.acronym }}{% endblock %} +{% block title %}Change position for {{ ad.plain_name }} on {{ wg.acronym }}{% endblock %} {% block morecss %} form.position-form .position ul { @@ -29,7 +29,7 @@ form.position-form .comment { {% endblock %} {% block content %} -

    Change position for {{ ad.name }} on {{ wg.acronym }}

    +

    Change position for {{ ad.plain_name }} on {{ wg.acronym }}

    diff --git a/ietf/templates/wgcharter/wg_info.txt b/ietf/templates/wgcharter/wg_info.txt index 3818ed4ec..11592bead 100644 --- a/ietf/templates/wgcharter/wg_info.txt +++ b/ietf/templates/wgcharter/wg_info.txt @@ -3,16 +3,16 @@ Current Status: {{ wg.state.name }} Working Group Chairs: -{% for p in info.chairs %} {{ p.name }} <{{p.email}}> +{% for p in info.chairs %} {{ p.plain_name }} <{{p.email}}> {% endfor %} Secretaries: -{% for p in info.secr %} {{ p.name }} <{{p.email}}> +{% for p in info.secr %} {{ p.plain_name }} <{{p.email}}> {% endfor %} Technical advisors: -{% for p in info.techadv %} {{ p.name }} <{{p.email}}> +{% for p in info.techadv %} {{ p.plain_name }} <{{p.email}}> {% endfor %} Assigned Area Director: - {{ info.ad.0.name }} <{{ info.ad.0.email }}> + {{ info.ad.0.plain_name }} <{{ info.ad.0.email }}> Mailing list: Address: {{ info.list.0 }} diff --git a/ietf/templates/wginfo/history.html b/ietf/templates/wginfo/history.html index d064b4a5d..ed86d4324 100644 --- a/ietf/templates/wginfo/history.html +++ b/ietf/templates/wginfo/history.html @@ -13,7 +13,7 @@ {% for e in events %}
- + {% endfor %} diff --git a/ietf/templates/wginfo/wg-charterREDESIGN.txt b/ietf/templates/wginfo/wg-charterREDESIGN.txt index 12ab03af6..ef99aa2ef 100644 --- a/ietf/templates/wginfo/wg-charterREDESIGN.txt +++ b/ietf/templates/wginfo/wg-charterREDESIGN.txt @@ -16,13 +16,13 @@ {{ wg.areadirector.person.name|safe }} <{{wg.areadirector.address}}> {% if wg.techadvisors %} Tech Advisor{{ wg.techadvisors|pluralize }}: -{% for techadvisor in wg.techadvisors %} {{ techadvisor.person.name|safe }} <{{techadvisor.address}}> +{% for techadvisor in wg.techadvisors %} {{ techadvisor.person.plain_name|safe }} <{{techadvisor.address}}> {% endfor %}{% endif %}{% if wg.editors %} Editor{{ wg.editors|pluralize }}: -{% for editor in wg.editors %} {{ editor.person.name|safe }} <{{editor.person.address}}> +{% for editor in wg.editors %} {{ editor.person.plain_name|safe }} <{{editor.person.address}}> {% endfor %}{% endif %}{% if wg.secretaries %} Secretar{{ wg.secretaries|pluralize:"y,ies" }}: -{% for secretary in wg.secretaries %} {{ secretary.person.name|safe }} <{{secretary.person.address}}> +{% for secretary in wg.secretaries %} {{ secretary.person.plain_name|safe }} <{{secretary.person.address}}> {% endfor %}{% endif %} Mailing Lists: General Discussion: {{ wg.email_address }} diff --git a/ietf/templates/wginfo/wg-dirREDESIGN.html b/ietf/templates/wginfo/wg-dirREDESIGN.html index a56c1f13c..212528123 100644 --- a/ietf/templates/wginfo/wg-dirREDESIGN.html +++ b/ietf/templates/wginfo/wg-dirREDESIGN.html @@ -58,7 +58,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Area Director{{ forloop.revcounter|pluralize }}:

Date
{{ e.time|date:"Y-m-d"}}{{ e.by.name }}{{ e.by.plain_name }} {{ e.desc|format_history_text }}
{% endif %} - + {% if forloop.last %}
  {{ ad.person.name }} <{{ ad.address }}>
  {{ ad.person.plain_name }} <{{ ad.address }}>
{% endif %} @@ -85,7 +85,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. {{ wg.acronym }} {% for ad in area.ads %}{% ifequal ad.person_id wg.ad_id %}{% endifequal %}{% endfor %} {{ wg.name }} - {% for chair in wg.chairs %}{{ chair.person.name }}{% if not forloop.last %}, {% endif %}{% endfor %} + {% for chair in wg.chairs %}{{ chair.person.plain_name }}{% if not forloop.last %}, {% endif %}{% endfor %} {% if forloop.last %} diff --git a/ietf/wgchairs/forms.py b/ietf/wgchairs/forms.py index 449c82aa1..e24d068fc 100644 --- a/ietf/wgchairs/forms.py +++ b/ietf/wgchairs/forms.py @@ -210,7 +210,7 @@ def assign_shepherd(user, internetdraft, shepherd): if not shepherd: e.desc = u"Unassigned shepherd" else: - e.desc = u"Changed shepherd to %s" % shepherd.name + e.desc = u"Changed shepherd to %s" % shepherd.plain_name() e.save() # update proxy too diff --git a/ietf/wgchairs/tests.py b/ietf/wgchairs/tests.py index 464ae37a7..4395b9e9a 100644 --- a/ietf/wgchairs/tests.py +++ b/ietf/wgchairs/tests.py @@ -94,7 +94,7 @@ class ManageDelegatesTestCase(django.test.TestCase): self.assertEquals(r.status_code, 200) q = PyQuery(r.content) self.assertTrue("new delegate" in r.content) - self.assertTrue(Email.objects.get(address="plain@example.com").person.name in r.content) + self.assertTrue(Email.objects.get(address="plain@example.com").person.plain_name() in r.content) self.assertEquals(Role.objects.filter(name="delegate", group__acronym="mars", email__address="plain@example.com").count(), 1) self.assertEquals(history_before + 1, GroupHistory.objects.filter(acronym="mars").count()) @@ -162,7 +162,7 @@ class ManageShepherdsTestCase(django.test.TestCase): # get r = self.client.get(url) self.assertEquals(r.status_code, 200) - self.assertTrue(Person.objects.get(user__username="secretary").name in r.content) + self.assertTrue(Person.objects.get(user__username="secretary").plain_name() in r.content) q = PyQuery(r.content) self.assertEquals(len(q('input[type=submit][name=remove_shepherd]')), 1) @@ -183,7 +183,7 @@ class ManageShepherdsTestCase(django.test.TestCase): self.assertEquals(r.status_code, 200) q = PyQuery(r.content) self.assertTrue("Shepherd assigned" in r.content) - self.assertTrue(Email.objects.get(address="plain@example.com").person.name in r.content) + self.assertTrue(Email.objects.get(address="plain@example.com").person.plain_name() in r.content) self.assertEquals(draft.docevent_set.count(), events_before + 1) class ManageWorkflowTestCase(django.test.TestCase): diff --git a/ietf/wgcharter/feeds.py b/ietf/wgcharter/feeds.py index faa5c7089..6fccc6d46 100644 --- a/ietf/wgcharter/feeds.py +++ b/ietf/wgcharter/feeds.py @@ -38,13 +38,13 @@ class GroupComments(Feed): for h in history: gh = find_history_active_at(obj, h['date']) if gh: - h['chairs'] = [x.email.person.name for x in gh.rolehistory_set.filter(name__slug="chair")] - h['secr'] = [x.email.person.name for x in gh.rolehistory_set.filter(name__slug="secr")] - h['techadv'] = [x.email.person.name for x in gh.rolehistory_set.filter(name__slug="techadv")] + h['chairs'] = [x.person.plain_name() for x in gh.rolehistory_set.filter(name__slug="chair")] + h['secr'] = [x.person.plain_name() for x in gh.rolehistory_set.filter(name__slug="secr")] + h['techadv'] = [x.person.plain_name() for x in gh.rolehistory_set.filter(name__slug="techadv")] else: - h['chairs'] = [x.email.person.name for x in obj.role_set.filter(name__slug="chair")] - h['secr'] = [x.email.person.name for x in obj.role_set.filter(name__slug="secr")] - h['techadv'] = [x.email.person.name for x in obj.role_set.filter(name__slug="techadv")] + h['chairs'] = [x.person.plain_name() for x in obj.role_set.filter(name__slug="chair")] + h['secr'] = [x.person.plain_name() for x in obj.role_set.filter(name__slug="secr")] + h['techadv'] = [x.person.plain_name() for x in obj.role_set.filter(name__slug="techadv")] dh = find_history_active_at(obj.charter, h['date']) if dh: h['rev'] = dh.rev diff --git a/ietf/wgcharter/mails.py b/ietf/wgcharter/mails.py index cab79d4c3..bc7278989 100644 --- a/ietf/wgcharter/mails.py +++ b/ietf/wgcharter/mails.py @@ -75,7 +75,7 @@ def generate_issue_ballot_mail(request, charter): return "[ ]" fmt = u"%-21s%-6s%-6s%-8s%-7s" % ( - p.ad.name, + p.ad.plain_name(), formatted(p.pos_id == "yes"), formatted(p.pos_id == "no"), formatted(p.pos_id == "block"), @@ -93,7 +93,7 @@ def generate_issue_ballot_mail(request, charter): active_ad_positions.sort() inactive_ad_positions.sort() - ad_feedback.sort(key=lambda p: p.ad.name) + ad_feedback.sort(key=lambda p: p.ad.plain_name()) e = charter.latest_event(WriteupDocEvent, type="changed_action_announcement") approval_text = e.text if e else "" diff --git a/ietf/wgcharter/templatetags/wg_ballot_icon.py b/ietf/wgcharter/templatetags/wg_ballot_icon.py index 712e36e4f..2cd1842e7 100644 --- a/ietf/wgcharter/templatetags/wg_ballot_icon.py +++ b/ietf/wgcharter/templatetags/wg_ballot_icon.py @@ -20,7 +20,7 @@ def get_user_name(context): if 'user' in context and context['user'].is_authenticated(): from person.models import Person try: - return context['user'].get_profile().name + return context['user'].get_profile().plain_name() except Person.DoesNotExist: return None diff --git a/ietf/wgcharter/utils.py b/ietf/wgcharter/utils.py index 0c5c8dab7..6adfe59e5 100644 --- a/ietf/wgcharter/utils.py +++ b/ietf/wgcharter/utils.py @@ -198,11 +198,10 @@ def update_telechat(request, doc, by, new_telechat_date): if on_agenda != prev_agenda: if on_agenda: - e.desc = "Placed on agenda for telechat - %s by %s" % ( - new_telechat_date, by.name) + e.desc = "Placed on agenda for telechat - %s" % new_telechat_date else: - e.desc = "Removed from agenda for telechat by %s" % by.name + e.desc = "Removed from agenda for telechat" e.save() elif on_agenda and new_telechat_date != prev_telechat: - e.desc = "Telechat date has been changed to %s from %s by %s" % (new_telechat_date, prev_telechat, by.name) + e.desc = "Telechat date has been changed to %s from %s" % (new_telechat_date, prev_telechat) e.save() diff --git a/ietf/wgcharter/views_edit.py b/ietf/wgcharter/views_edit.py index 4057af090..a34b7d23e 100644 --- a/ietf/wgcharter/views_edit.py +++ b/ietf/wgcharter/views_edit.py @@ -120,7 +120,7 @@ def change_state(request, name, option=None): if change and charter: messages = {} - messages['extrev'] = "The WG has been set to External review by %s. Please schedule discussion for the next IESG telechat." % login.name + messages['extrev'] = "The WG has been set to External review by %s. Please schedule discussion for the next IESG telechat." % login.plain_name() if message: email_secretariat(request, wg, "state-%s" % charter_state.slug, message) @@ -148,13 +148,13 @@ def change_state(request, name, option=None): else: if option == "recharter": hide = ['charter_state'] - init = dict(initial_time=1, message="%s has initiated a recharter effort on the WG %s (%s)" % (login.name, wg.name, wg.acronym)) + init = dict(initial_time=1, message="%s has initiated a recharter effort on the WG %s (%s)" % (login.plain_name(), wg.name, wg.acronym)) elif option == "initcharter": hide = ['charter_state'] - init = dict(initial_time=1, message="%s has initiated chartering of the proposed WG %s (%s)" % (login.name, wg.name, wg.acronym)) + init = dict(initial_time=1, message="%s has initiated chartering of the proposed WG %s (%s)" % (login.plain_name(), wg.name, wg.acronym)) elif option == "abandon": hide = ['initial_time', 'charter_state'] - init = dict(message="%s has abandoned the chartering effort on the WG %s (%s)" % (login.name, wg.name, wg.acronym)) + init = dict(message="%s has abandoned the chartering effort on the WG %s (%s)" % (login.plain_name(), wg.name, wg.acronym)) else: hide = ['initial_time'] init = dict(charter_state=wg.charter.get_state_slug(), state=wg.state_id) @@ -218,7 +218,7 @@ class EditInfoForm(forms.Form): ad_pk = self.initial.get('ad') choices = self.fields['ad'].choices if ad_pk and ad_pk not in [pk for pk, name in choices]: - self.fields['ad'].choices = list(choices) + [("", "-------"), (ad_pk, Person.objects.get(pk=ad_pk).name)] + self.fields['ad'].choices = list(choices) + [("", "-------"), (ad_pk, Person.objects.get(pk=ad_pk).plain_name())] # telechat choices dates = [d.date for d in TelechatDate.objects.active().order_by('date')] if 'telechat_date' in kwargs['initial']: diff --git a/ietf/wgcharter/views_search.py b/ietf/wgcharter/views_search.py index e8d3cc9ab..6ad6206ce 100644 --- a/ietf/wgcharter/views_search.py +++ b/ietf/wgcharter/views_search.py @@ -44,7 +44,7 @@ class SearchForm(forms.Form): active_ads.sort(key=extract_last_name) inactive_ads.sort(key=extract_last_name) - self.fields['ad'].choices = c = [('', 'any AD')] + [(ad.pk, ad.name) for ad in active_ads] + [('', '------------------')] + [(ad.pk, ad.name) for ad in inactive_ads] + 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] def clean_nameacronym(self): value = self.cleaned_data.get('nameacronym','') @@ -287,7 +287,7 @@ def in_process(request): def json_emails(l): result = [] for p in l: - result.append({"id": p.address + "", "name": p.person.name + " <" + p.address + ">"}) + result.append({"id": p.address + "", "name": p.person.plain_name() + " <" + p.address + ">"}) return simplejson.dumps(result) def search_person(request):