Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions ietf/doc/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
import datetime
import debug #pyflakes:ignore
from django import forms
from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist, ValidationError
from django.core.validators import validate_email
from django.db.models.functions import Collate

from ietf.doc.fields import SearchableDocumentField, SearchableDocumentsField
from ietf.doc.models import RelatedDocument, DocExtResource, State
Expand Down Expand Up @@ -63,8 +65,14 @@ class DocAuthorChangeBasisForm(forms.Form):
help_text='What is the source or reasoning for the changes to the author list?')

class AdForm(forms.Form):
ad = forms.ModelChoiceField(Person.objects.filter(role__name="ad", role__group__state="active", role__group__type='area').order_by('name'),
label="Shepherding AD", empty_label="(None)", required=True)
ad = forms.ModelChoiceField(
Person.objects.filter(
role__name="ad", role__group__state="active", role__group__type="area"
).order_by(Collate("name", settings.PREFERRED_COLLATION)),
label="Shepherding AD",
empty_label="(None)",
required=True,
)

def __init__(self, *args, **kwargs):
super(self.__class__, self).__init__(*args, **kwargs)
Expand Down
11 changes: 9 additions & 2 deletions ietf/doc/views_charter.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from django.utils import timezone
from django.utils.encoding import force_str
from django.utils.html import escape
from django.db.models.functions import Collate

import debug # pyflakes:ignore

Expand Down Expand Up @@ -305,8 +306,14 @@ def change_title(request, name, option=None):
))

class AdForm(forms.Form):
ad = forms.ModelChoiceField(Person.objects.filter(role__name="ad", role__group__state="active", role__group__type="area").order_by('name'),
label="Responsible AD", empty_label="(None)", required=True)
ad = forms.ModelChoiceField(
Person.objects.filter(
role__name="ad", role__group__state="active", role__group__type="area"
).order_by(Collate("name", settings.PREFERRED_COLLATION)),
label="Responsible AD",
empty_label="(None)",
required=True,
)

def __init__(self, *args, **kwargs):
super(self.__class__, self).__init__(*args, **kwargs)
Expand Down
11 changes: 9 additions & 2 deletions ietf/doc/views_conflict_review.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from django.template.loader import render_to_string
from django.conf import settings
from django.utils.html import escape
from django.db.models.functions import Collate

import debug # pyflakes:ignore

Expand Down Expand Up @@ -404,8 +405,14 @@ class SimpleStartReviewForm(forms.Form):
)

class StartReviewForm(forms.Form):
ad = forms.ModelChoiceField(Person.objects.filter(role__name="ad", role__group__state="active",role__group__type='area').order_by('name'),
label="Shepherding AD", empty_label="(None)", required=True)
ad = forms.ModelChoiceField(
Person.objects.filter(
role__name="ad", role__group__state="active", role__group__type="area"
).order_by(Collate("name", settings.PREFERRED_COLLATION)),
label="Shepherding AD",
empty_label="(None)",
required=True,
)
create_in_state = forms.ModelChoiceField(State.objects.filter(used=True, type="conflrev", slug__in=("needshep", "adrev")), empty_label=None, required=False)
notify = forms.CharField(
widget=forms.Textarea,
Expand Down
4 changes: 3 additions & 1 deletion ietf/doc/views_draft.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
from django.forms.utils import ErrorList
from django.template.defaultfilters import pluralize
from django.utils import timezone
from django.db.models.functions import Collate


import debug # pyflakes:ignore

Expand Down Expand Up @@ -1130,7 +1132,7 @@ class AdForm(forms.Form):
role__name__in=("ad", "pre-ad"),
role__group__state="active",
role__group__type="area",
).order_by('name'),
).order_by(Collate('name', settings.PREFERRED_COLLATION)),
label="Shepherding AD",
empty_label="(None)",
required=False,
Expand Down
11 changes: 9 additions & 2 deletions ietf/doc/views_status_change.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from django.conf import settings
from django.utils.encoding import force_str
from django.utils.html import escape
from django.db.models.functions import Collate

import debug # pyflakes:ignore
from ietf.doc.mails import email_ad_approved_status_change
Expand Down Expand Up @@ -484,8 +485,14 @@ def clean(self):
class StartStatusChangeForm(forms.Form):
document_name = forms.CharField(max_length=255, label="Document name", help_text="A descriptive name such as status-change-md2-to-historic is better than status-change-rfc1319.", required=True)
title = forms.CharField(max_length=255, label="Title", required=True)
ad = forms.ModelChoiceField(Person.objects.filter(role__name="ad", role__group__state="active",role__group__type='area').order_by('name'),
label="Shepherding AD", empty_label="(None)", required=False)
ad = forms.ModelChoiceField(
Person.objects.filter(
role__name="ad", role__group__state="active", role__group__type="area"
).order_by(Collate("name", settings.PREFERRED_COLLATION)),
label="Shepherding AD",
empty_label="(None)",
required=False,
)
create_in_state = forms.ModelChoiceField(State.objects.filter(type="statchg", slug__in=("needshep", "adrev")), empty_label=None, required=False)
notify = forms.CharField(
widget=forms.Textarea,
Expand Down
8 changes: 8 additions & 0 deletions ietf/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,14 @@
}


# Collation that we wish we were using. The production database is currently using
# the C collation, which does not handle accented characters. Do not change this
# without confirming that the production and dev databases support the new collation.
# This setting and places we use it can go away if we switch the production database
# collation. That requires creating and populating a new database, it cannot be done
# on an existing one.
PREFERRED_COLLATION = "en-US-x-icu"

# Local time zone for this installation. Choices can be found here:
# http://www.postgresql.org/docs/8.1/static/datetime-keywords.html#DATETIME-TIMEZONE-SET-TABLE
# although not all variations may be possible on all operating systems.
Expand Down
Loading