Skip to content

Commit 64b9615

Browse files
committed
Changed most instances of 'registrations' to 'attendees' in the meeting statistics code (as that's what the numbers show)
- Legacy-Id: 13486
1 parent b6b4516 commit 64b9615

6 files changed

Lines changed: 33 additions & 33 deletions

File tree

ietf/stats/tests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def test_document_stats(self):
3434
rev=draft.rev,
3535
words=4000,
3636
draft=draft,
37-
file_types="txt",
37+
file_types=".txt",
3838
state_id="posted",
3939
)
4040

ietf/stats/views.py

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -775,30 +775,30 @@ def build_meeting_stats_url(number=None, stats_type_override=Ellipsis, get_overr
775775
bin_size = 1
776776
eu_countries = None
777777

778-
def get_country_mapping(registrations):
778+
def get_country_mapping(attendees):
779779
return {
780780
alias.alias: alias.country
781-
for alias in CountryAlias.objects.filter(alias__in=set(r.country_code for r in registrations)).select_related("country", "country__continent")
781+
for alias in CountryAlias.objects.filter(alias__in=set(r.country_code for r in attendees)).select_related("country", "country__continent")
782782
if alias.alias.isupper()
783783
}
784784

785785
def reg_name(r):
786786
return email.utils.formataddr(((r.first_name + u" " + r.last_name).strip(), r.email))
787787

788788
if meeting and any(stats_type == t[0] for t in possible_stats_types):
789-
registrations = MeetingRegistration.objects.filter(meeting=meeting)
789+
attendees = MeetingRegistration.objects.filter(meeting=meeting)
790790

791791
if stats_type == "country":
792-
stats_title = "Number of registrations for {} {} per country".format(meeting.type.name, meeting.number)
792+
stats_title = "Number of attendees for {} {} per country".format(meeting.type.name, meeting.number)
793793

794794
bins = defaultdict(set)
795795

796-
country_mapping = get_country_mapping(registrations)
796+
country_mapping = get_country_mapping(attendees)
797797

798798
eu_name = "EU"
799799
eu_countries = set(CountryName.objects.filter(in_eu=True))
800800

801-
for r in registrations:
801+
for r in attendees:
802802
name = reg_name(r)
803803
c = country_mapping.get(r.country_code)
804804
bins[c.name if c else ""].add(name)
@@ -807,11 +807,11 @@ def reg_name(r):
807807
bins[eu_name].add(name)
808808

809809
prune_unknown_bin_with_known(bins)
810-
total_registrations = count_bins(bins)
810+
total_attendees = count_bins(bins)
811811

812812
series_data = []
813813
for country, names in sorted(bins.iteritems(), key=lambda t: t[0].lower()):
814-
percentage = len(names) * 100.0 / (total_registrations or 1)
814+
percentage = len(names) * 100.0 / (total_attendees or 1)
815815
if country:
816816
series_data.append((country, len(names)))
817817
table_data.append((country, percentage, names))
@@ -829,23 +829,23 @@ def reg_name(r):
829829
chart_data.append({ "data": series_data })
830830

831831
elif stats_type == "continent":
832-
stats_title = "Number of registrations for {} {} per continent".format(meeting.type.name, meeting.number)
832+
stats_title = "Number of attendees for {} {} per continent".format(meeting.type.name, meeting.number)
833833

834834
bins = defaultdict(set)
835835

836-
country_mapping = get_country_mapping(registrations)
836+
country_mapping = get_country_mapping(attendees)
837837

838-
for r in registrations:
838+
for r in attendees:
839839
name = reg_name(r)
840840
c = country_mapping.get(r.country_code)
841841
bins[c.continent.name if c else ""].add(name)
842842

843843
prune_unknown_bin_with_known(bins)
844-
total_registrations = count_bins(bins)
844+
total_attendees = count_bins(bins)
845845

846846
series_data = []
847847
for continent, names in sorted(bins.iteritems(), key=lambda t: t[0].lower()):
848-
percentage = len(names) * 100.0 / (total_registrations or 1)
848+
percentage = len(names) * 100.0 / (total_attendees or 1)
849849
if continent:
850850
series_data.append((continent, len(names)))
851851
table_data.append((continent, percentage, names))
@@ -858,14 +858,14 @@ def reg_name(r):
858858
elif not meeting and any(stats_type == t[0] for t in possible_stats_types):
859859
template_name = "overview"
860860

861-
registrations = MeetingRegistration.objects.filter(meeting__type="ietf").select_related('meeting')
861+
attendees = MeetingRegistration.objects.filter(meeting__type="ietf").select_related('meeting')
862862

863863
if stats_type == "overview":
864-
stats_title = "Number of registrations per meeting"
864+
stats_title = "Number of attendees per meeting"
865865

866866
bins = defaultdict(set)
867867

868-
for r in registrations:
868+
for r in attendees:
869869
meeting_number = int(r.meeting.number)
870870
name = reg_name(r)
871871

@@ -883,20 +883,20 @@ def reg_name(r):
883883
series_data.sort(key=lambda t: t[0])
884884
table_data.sort(key=lambda t: t[0], reverse=True)
885885

886-
chart_data.append({ "name": "Registrations", "data": series_data })
886+
chart_data.append({ "name": "Attendees", "data": series_data })
887887

888888

889889
elif stats_type == "country":
890-
stats_title = "Number of registrations per country across meetings"
890+
stats_title = "Number of attendees per country across meetings"
891891

892-
country_mapping = get_country_mapping(registrations)
892+
country_mapping = get_country_mapping(attendees)
893893

894894
eu_name = "EU"
895895
eu_countries = set(CountryName.objects.filter(in_eu=True))
896896

897897
bins = defaultdict(set)
898898

899-
for r in registrations:
899+
for r in attendees:
900900
meeting_number = int(r.meeting.number)
901901
name = reg_name(r)
902902
c = country_mapping.get(r.country_code)
@@ -910,13 +910,13 @@ def reg_name(r):
910910

911911

912912
elif stats_type == "continent":
913-
stats_title = "Number of registrations per country across meetings"
913+
stats_title = "Number of attendees per continent across meetings"
914914

915-
country_mapping = get_country_mapping(registrations)
915+
country_mapping = get_country_mapping(attendees)
916916

917917
bins = defaultdict(set)
918918

919-
for r in registrations:
919+
for r in attendees:
920920
meeting_number = int(r.meeting.number)
921921
name = reg_name(r)
922922
c = country_mapping.get(r.country_code)

ietf/templates/stats/meeting_stats.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ <h1>Meeting Statistics</h1>
2323

2424
<div class="stats-options well">
2525
<div>
26-
Registrations:
26+
Attendees:
2727

2828
<div class="btn-group">
2929
{% for slug, label, url in possible_stats_types %}

ietf/templates/stats/meeting_stats_continent.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ <h3>{{ stats_title }}</h3>
2323
},
2424
yAxis: {
2525
title: {
26-
text: 'Number of registrations'
26+
text: 'Number of attendees'
2727
}
2828
},
2929
tooltip: {
@@ -48,8 +48,8 @@ <h3>Data</h3>
4848
<thead>
4949
<tr>
5050
<th>Continent</th>
51-
<th>Percentage of registrations</th>
52-
<th>Registrations</th>
51+
<th>Percentage of attendees</th>
52+
<th>Attendees</th>
5353
</tr>
5454
</thead>
5555
<tbody>

ietf/templates/stats/meeting_stats_country.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ <h3>{{ stats_title }}</h3>
2323
},
2424
yAxis: {
2525
title: {
26-
text: 'Number of registrations'
26+
text: 'Number of attendees'
2727
}
2828
},
2929
tooltip: {
@@ -78,8 +78,8 @@ <h3>Data</h3>
7878
<thead>
7979
<tr>
8080
<th>Country</th>
81-
<th>Percentage of registrations</th>
82-
<th>Registrations</th>
81+
<th>Percentage of attendees</th>
82+
<th>Attendees</th>
8383
</tr>
8484
</thead>
8585
<tbody>

ietf/templates/stats/meeting_stats_overview.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ <h3>{{ stats_title }}</h3>
3535
yAxis: {
3636
min: 0,
3737
title: {
38-
text: 'Registrations at meeting'
38+
text: 'Attendees at meeting'
3939
}
4040
},
4141
tooltip: {
@@ -61,7 +61,7 @@ <h3>Data</h3>
6161
<thead>
6262
<tr>
6363
<th>Meeting</th>
64-
<th>Registrations</th>
64+
<th>Attendees</th>
6565
</tr>
6666
</thead>
6767
<tbody>

0 commit comments

Comments
 (0)