Skip to content

Commit

Permalink
Bug 1119312: Upgrade Django to 1.6.9
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
pmac authored and jgmize committed Jan 12, 2015
1 parent bf549cc commit 016fc02
Show file tree
Hide file tree
Showing 13 changed files with 49 additions and 38 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,6 @@
[submodule "vendor-local/src/django-filter"]
path = vendor-local/src/django-filter
url = https://github.com/alex/django-filter.git
[submodule "vendor-local/src/django"]
path = vendor-local/src/django
url = git://github.com/django/django.git
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ cache:
before_script:
- flake8 bedrock lib
- mysql -e 'create database bedrock_test;'
- python manage.py version
- python manage.py syncdb --noinput --migrate
- python manage.py update_product_details
- svn checkout https://svn.mozilla.org/projects/mozilla.com/trunk/locales/ locale
Expand Down
15 changes: 10 additions & 5 deletions bedrock/legal/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,16 @@ class FraudReportForm(forms.Form):
)
input_category = forms.ChoiceField(
choices=(
('Charging for software', _lazy(u'Charging for software')),
('Collecting personal information', _lazy(u'Collecting personal information')),
('Domain name violation', _lazy(u'Domain name violation')),
('Logo misuse/modification', _lazy(u'Logo misuse/modification')),
('Distributing modified Firefox/malware', _lazy(u'Distributing modified Firefox/malware')),
('Charging for software',
_lazy(u'Charging for software')),
('Collecting personal information',
_lazy(u'Collecting personal information')),
('Domain name violation',
_lazy(u'Domain name violation')),
('Logo misuse/modification',
_lazy(u'Logo misuse/modification')),
('Distributing modified Firefox/malware',
_lazy(u'Distributing modified Firefox/malware')),
),
required=True,
error_messages={
Expand Down
6 changes: 3 additions & 3 deletions bedrock/legal/templates/legal/emails/fraud-report.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ A new violating website report has been submitted with the following information
{{ input_product }}

+ Specific product
{{ input_specific_product|safe|strip_tags }}
{{ input_specific_product|strip_tags|safe }}

+ Other details...
{{ input_details|safe|strip_tags }}
{{ input_details|strip_tags|safe }}

+ Attachments...
{{ input_attachment_desc|safe|strip_tags }}
{{ input_attachment_desc|strip_tags|safe }}

+ Email
{{ input_email }}
6 changes: 3 additions & 3 deletions bedrock/legal/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,10 +227,10 @@ def test_emails_not_escaped(self):
Tags are still stripped, though.
"""

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

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

STRING3 = u"J'adore <coffee>el café</coffee> también"
Expand Down
2 changes: 1 addition & 1 deletion bedrock/legal/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def submit_form(request, form):

attachment = form.cleaned_data['input_attachment']

if (attachment):
if attachment:
email.attach(attachment.name, attachment.read(), attachment.content_type)

email.send()
Expand Down
2 changes: 1 addition & 1 deletion bedrock/mozorg/templates/mozorg/emails/infos.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Email: {{ email }}
Area of Interest: {{ interest }}
Language: {{ request.locale }}
Comment: {{ comments|safe|strip_tags }}
Comment: {{ comments|strip_tags|safe }}
8 changes: 4 additions & 4 deletions bedrock/mozorg/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,8 +423,8 @@ def test_emails_not_escaped(self):
Tags are still stripped, though.
"""
STRING = u"J'adore Citröns & <Piñatas> so there"
EXPECTED = u"J'adore Citröns & so there"
STRING = u"<strong>J'adore Citröns</strong> & <Piñatas> so there"
EXPECTED = u"J'adore Citröns & <Piñatas> so there"
self.data.update(comments=STRING)
self.client.post(self.url_en, self.data)
eq_(len(mail.outbox), 2)
Expand Down Expand Up @@ -592,8 +592,8 @@ def test_emails_not_escaped(self):
Tags are still stripped, though.
"""
STRING = u"J'adore Citröns & <Piñatas> so there"
EXPECTED = u"J'adore Citröns & so there"
STRING = u"<em>J'adore Citröns</em> & <Piñatas> so there"
EXPECTED = u"J'adore Citröns & <Piñatas> so there"
self.data.update(comments=STRING)
self.client.post(self.url_en, self.data)
eq_(len(mail.outbox), 2)
Expand Down
36 changes: 18 additions & 18 deletions bedrock/press/templates/press/emails/speaker-request.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
A new speaker request form has been submitted with the following information:

+ Event Name
{{ sr_event_name|safe|strip_tags }}
{{ sr_event_name|strip_tags|safe }}

+ Event URL
{{ sr_event_url }}
Expand All @@ -15,29 +15,29 @@ Guest Speaker

{% if sr_guest_speaker1 %}
+ Choice 1
{{ sr_guest_speaker1|safe|strip_tags }}
{{ sr_guest_speaker1|strip_tags|safe }}
{% endif %}
{% if sr_guest_speaker2 %}

+ Choice 2
{{ sr_guest_speaker2|safe|strip_tags }}
{{ sr_guest_speaker2|strip_tags|safe }}
{% endif %}

{% endif %}
------------------------------------
Contact Information

+ Name
{{ sr_contact_name|safe|strip_tags }}
{{ sr_contact_name|strip_tags|safe }}
{% if sr_contact_title %}

+ Title
{{ sr_contact_title|safe|strip_tags }}
{{ sr_contact_title|strip_tags|safe }}
{% endif %}
{% if sr_contact_company %}

+ Company
{{ sr_contact_company|safe|strip_tags }}
{{ sr_contact_company|strip_tags|safe }}
{% endif %}
{% if sr_contact_phone %}

Expand All @@ -58,22 +58,22 @@ Event Details

{% if sr_event_venue %}
+ Venue
{{ sr_event_venue|safe|strip_tags }}
{{ sr_event_venue|strip_tags|safe }}
{% endif %}
{% if sr_event_theme %}

+ Theme
{{ sr_event_theme|safe|strip_tags }}
{{ sr_event_theme|strip_tags|safe }}
{% endif %}
{% if sr_event_goal %}

+ Goal
{{ sr_event_goal|safe|strip_tags }}
{{ sr_event_goal|strip_tags|safe }}
{% endif %}
{% if sr_event_format %}

+ Format
{{ sr_event_format|safe|strip_tags }}
{{ sr_event_format|strip_tags|safe }}
{% endif %}
{% if sr_event_audience_size %}

Expand All @@ -83,32 +83,32 @@ Event Details
{% if sr_event_audience_demographics %}

+ Audience Demographics
{{ sr_event_audience_demographics|safe|strip_tags }}
{{ sr_event_audience_demographics|strip_tags|safe }}
{% endif %}
{% if sr_event_speakers_confirmed %}

+ Confirmed Speakers
{{ sr_event_speakers_confirmed|safe|strip_tags }}
{{ sr_event_speakers_confirmed|strip_tags|safe }}
{% endif %}
{% if sr_event_speakers_invited %}

+ Invited Speakers
{{ sr_event_speakers_invited|safe|strip_tags }}
{{ sr_event_speakers_invited|strip_tags|safe }}
{% endif %}
{% if sr_event_speakers_past %}

+ Past Speakers
{{ sr_event_speakers_past|safe|strip_tags }}
{{ sr_event_speakers_past|strip_tags|safe }}
{% endif %}
{% if sr_event_media_coverage %}

+ Media Coverage
{{ sr_event_media_coverage|safe|strip_tags }}
{{ sr_event_media_coverage|strip_tags|safe }}
{% endif %}
{% if sr_event_sponsors %}

+ Event Sponsors
{{ sr_event_sponsors|safe|strip_tags }}
{{ sr_event_sponsors|strip_tags|safe }}
{% endif %}
{% if sr_event_confirmation_deadline %}

Expand All @@ -126,12 +126,12 @@ Presentation Details
{% if sr_presentation_panelists %}

+ Other Panelists
{{ sr_presentation_panelists|safe|strip_tags }}
{{ sr_presentation_panelists|strip_tags|safe }}
{% endif %}
{% if sr_presentation_topic %}

+ Topic of Presentation
{{ sr_presentation_topic|safe|strip_tags }}
{{ sr_presentation_topic|strip_tags|safe }}
{% endif %}
{% if sr_presentation_length %}

Expand Down
4 changes: 2 additions & 2 deletions bedrock/press/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,8 @@ def test_emails_not_escaped(self):
Tags are still stripped, though.
"""

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

STRING2 = u"J'adore Piñatas & <fromage> so here"
EXPECTED2 = u"J'adore Piñatas & so here"
Expand Down
2 changes: 1 addition & 1 deletion vendor
Submodule vendor updated 1 files
+1 −1 src/funfactory
1 change: 1 addition & 0 deletions vendor-local/src/django
Submodule django added at 4747c2
1 change: 1 addition & 0 deletions vendor-local/vendor.pth
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ packages/pytz
packages/PyYAML/lib
src/basket-client
src/chkcrontab
src/django
src/django-dnt
src/django-extensions
src/django-filter
Expand Down

0 comments on commit 016fc02

Please sign in to comment.