Skip to content

Commit 016fc02

Browse files
pmacjgmize
authored andcommitted
Bug 1119312: Upgrade Django to 1.6.9
Also fixes some tests that were failing after upgrade. Code was relying on Django's strip_tags filter which has changed and now ignores things that obviously aren't HTML tags Updated to latest playdoh-lib which includes fixes for Django 1.6 in funfactory.
1 parent bf549cc commit 016fc02

File tree

13 files changed

+49
-38
lines changed

13 files changed

+49
-38
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,6 @@
6161
[submodule "vendor-local/src/django-filter"]
6262
path = vendor-local/src/django-filter
6363
url = https://github.com/alex/django-filter.git
64+
[submodule "vendor-local/src/django"]
65+
path = vendor-local/src/django
66+
url = git://github.com/django/django.git

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ cache:
1010
before_script:
1111
- flake8 bedrock lib
1212
- mysql -e 'create database bedrock_test;'
13+
- python manage.py version
1314
- python manage.py syncdb --noinput --migrate
1415
- python manage.py update_product_details
1516
- svn checkout https://svn.mozilla.org/projects/mozilla.com/trunk/locales/ locale

bedrock/legal/forms.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,16 @@ class FraudReportForm(forms.Form):
3333
)
3434
input_category = forms.ChoiceField(
3535
choices=(
36-
('Charging for software', _lazy(u'Charging for software')),
37-
('Collecting personal information', _lazy(u'Collecting personal information')),
38-
('Domain name violation', _lazy(u'Domain name violation')),
39-
('Logo misuse/modification', _lazy(u'Logo misuse/modification')),
40-
('Distributing modified Firefox/malware', _lazy(u'Distributing modified Firefox/malware')),
36+
('Charging for software',
37+
_lazy(u'Charging for software')),
38+
('Collecting personal information',
39+
_lazy(u'Collecting personal information')),
40+
('Domain name violation',
41+
_lazy(u'Domain name violation')),
42+
('Logo misuse/modification',
43+
_lazy(u'Logo misuse/modification')),
44+
('Distributing modified Firefox/malware',
45+
_lazy(u'Distributing modified Firefox/malware')),
4146
),
4247
required=True,
4348
error_messages={

bedrock/legal/templates/legal/emails/fraud-report.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ A new violating website report has been submitted with the following information
1010
{{ input_product }}
1111

1212
+ Specific product
13-
{{ input_specific_product|safe|strip_tags }}
13+
{{ input_specific_product|strip_tags|safe }}
1414

1515
+ Other details...
16-
{{ input_details|safe|strip_tags }}
16+
{{ input_details|strip_tags|safe }}
1717

1818
+ Attachments...
19-
{{ input_attachment_desc|safe|strip_tags }}
19+
{{ input_attachment_desc|strip_tags|safe }}
2020

2121
+ Email
2222
{{ input_email }}

bedrock/legal/tests.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -227,10 +227,10 @@ def test_emails_not_escaped(self):
227227
Tags are still stripped, though.
228228
"""
229229

230-
STRING1 = u"J'adore Citröns & <Piñatas> so there"
231-
EXPECTED1 = u"J'adore Citröns & so there"
230+
STRING1 = u"<em>J'adore Citröns</em> & <Piñatas> so there"
231+
EXPECTED1 = u"J'adore Citröns & <Piñatas> so there"
232232

233-
STRING2 = u"J'adore Piñatas & <fromage> so here"
233+
STRING2 = u"<em>J'adore Piñatas</em> & <fromage> so here"
234234
EXPECTED2 = u"J'adore Piñatas & so here"
235235

236236
STRING3 = u"J'adore <coffee>el café</coffee> también"

bedrock/legal/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def submit_form(request, form):
3434

3535
attachment = form.cleaned_data['input_attachment']
3636

37-
if (attachment):
37+
if attachment:
3838
email.attach(attachment.name, attachment.read(), attachment.content_type)
3939

4040
email.send()
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
Email: {{ email }}
22
Area of Interest: {{ interest }}
33
Language: {{ request.locale }}
4-
Comment: {{ comments|safe|strip_tags }}
4+
Comment: {{ comments|strip_tags|safe }}

bedrock/mozorg/tests/test_views.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -423,8 +423,8 @@ def test_emails_not_escaped(self):
423423
424424
Tags are still stripped, though.
425425
"""
426-
STRING = u"J'adore Citröns & <Piñatas> so there"
427-
EXPECTED = u"J'adore Citröns & so there"
426+
STRING = u"<strong>J'adore Citröns</strong> & <Piñatas> so there"
427+
EXPECTED = u"J'adore Citröns & <Piñatas> so there"
428428
self.data.update(comments=STRING)
429429
self.client.post(self.url_en, self.data)
430430
eq_(len(mail.outbox), 2)
@@ -592,8 +592,8 @@ def test_emails_not_escaped(self):
592592
593593
Tags are still stripped, though.
594594
"""
595-
STRING = u"J'adore Citröns & <Piñatas> so there"
596-
EXPECTED = u"J'adore Citröns & so there"
595+
STRING = u"<em>J'adore Citröns</em> & <Piñatas> so there"
596+
EXPECTED = u"J'adore Citröns & <Piñatas> so there"
597597
self.data.update(comments=STRING)
598598
self.client.post(self.url_en, self.data)
599599
eq_(len(mail.outbox), 2)

bedrock/press/templates/press/emails/speaker-request.txt

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
A new speaker request form has been submitted with the following information:
22

33
+ Event Name
4-
{{ sr_event_name|safe|strip_tags }}
4+
{{ sr_event_name|strip_tags|safe }}
55

66
+ Event URL
77
{{ sr_event_url }}
@@ -15,29 +15,29 @@ Guest Speaker
1515

1616
{% if sr_guest_speaker1 %}
1717
+ Choice 1
18-
{{ sr_guest_speaker1|safe|strip_tags }}
18+
{{ sr_guest_speaker1|strip_tags|safe }}
1919
{% endif %}
2020
{% if sr_guest_speaker2 %}
2121

2222
+ Choice 2
23-
{{ sr_guest_speaker2|safe|strip_tags }}
23+
{{ sr_guest_speaker2|strip_tags|safe }}
2424
{% endif %}
2525

2626
{% endif %}
2727
------------------------------------
2828
Contact Information
2929

3030
+ Name
31-
{{ sr_contact_name|safe|strip_tags }}
31+
{{ sr_contact_name|strip_tags|safe }}
3232
{% if sr_contact_title %}
3333

3434
+ Title
35-
{{ sr_contact_title|safe|strip_tags }}
35+
{{ sr_contact_title|strip_tags|safe }}
3636
{% endif %}
3737
{% if sr_contact_company %}
3838

3939
+ Company
40-
{{ sr_contact_company|safe|strip_tags }}
40+
{{ sr_contact_company|strip_tags|safe }}
4141
{% endif %}
4242
{% if sr_contact_phone %}
4343

@@ -58,22 +58,22 @@ Event Details
5858

5959
{% if sr_event_venue %}
6060
+ Venue
61-
{{ sr_event_venue|safe|strip_tags }}
61+
{{ sr_event_venue|strip_tags|safe }}
6262
{% endif %}
6363
{% if sr_event_theme %}
6464

6565
+ Theme
66-
{{ sr_event_theme|safe|strip_tags }}
66+
{{ sr_event_theme|strip_tags|safe }}
6767
{% endif %}
6868
{% if sr_event_goal %}
6969

7070
+ Goal
71-
{{ sr_event_goal|safe|strip_tags }}
71+
{{ sr_event_goal|strip_tags|safe }}
7272
{% endif %}
7373
{% if sr_event_format %}
7474

7575
+ Format
76-
{{ sr_event_format|safe|strip_tags }}
76+
{{ sr_event_format|strip_tags|safe }}
7777
{% endif %}
7878
{% if sr_event_audience_size %}
7979

@@ -83,32 +83,32 @@ Event Details
8383
{% if sr_event_audience_demographics %}
8484

8585
+ Audience Demographics
86-
{{ sr_event_audience_demographics|safe|strip_tags }}
86+
{{ sr_event_audience_demographics|strip_tags|safe }}
8787
{% endif %}
8888
{% if sr_event_speakers_confirmed %}
8989

9090
+ Confirmed Speakers
91-
{{ sr_event_speakers_confirmed|safe|strip_tags }}
91+
{{ sr_event_speakers_confirmed|strip_tags|safe }}
9292
{% endif %}
9393
{% if sr_event_speakers_invited %}
9494

9595
+ Invited Speakers
96-
{{ sr_event_speakers_invited|safe|strip_tags }}
96+
{{ sr_event_speakers_invited|strip_tags|safe }}
9797
{% endif %}
9898
{% if sr_event_speakers_past %}
9999

100100
+ Past Speakers
101-
{{ sr_event_speakers_past|safe|strip_tags }}
101+
{{ sr_event_speakers_past|strip_tags|safe }}
102102
{% endif %}
103103
{% if sr_event_media_coverage %}
104104

105105
+ Media Coverage
106-
{{ sr_event_media_coverage|safe|strip_tags }}
106+
{{ sr_event_media_coverage|strip_tags|safe }}
107107
{% endif %}
108108
{% if sr_event_sponsors %}
109109

110110
+ Event Sponsors
111-
{{ sr_event_sponsors|safe|strip_tags }}
111+
{{ sr_event_sponsors|strip_tags|safe }}
112112
{% endif %}
113113
{% if sr_event_confirmation_deadline %}
114114

@@ -126,12 +126,12 @@ Presentation Details
126126
{% if sr_presentation_panelists %}
127127

128128
+ Other Panelists
129-
{{ sr_presentation_panelists|safe|strip_tags }}
129+
{{ sr_presentation_panelists|strip_tags|safe }}
130130
{% endif %}
131131
{% if sr_presentation_topic %}
132132

133133
+ Topic of Presentation
134-
{{ sr_presentation_topic|safe|strip_tags }}
134+
{{ sr_presentation_topic|strip_tags|safe }}
135135
{% endif %}
136136
{% if sr_presentation_length %}
137137

bedrock/press/tests.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,8 @@ def test_emails_not_escaped(self):
244244
Tags are still stripped, though.
245245
"""
246246

247-
STRING1 = u"J'adore Citröns & <Piñatas> so there"
248-
EXPECTED1 = u"J'adore Citröns & so there"
247+
STRING1 = u"<blink>J'adore Citröns</blink> & <Piñatas> so there"
248+
EXPECTED1 = u"J'adore Citröns & <Piñatas> so there"
249249

250250
STRING2 = u"J'adore Piñatas & <fromage> so here"
251251
EXPECTED2 = u"J'adore Piñatas & so here"

0 commit comments

Comments
 (0)