Opened 21 months ago

Closed 21 months ago

Last modified 21 months ago

#20773 closed Bug (fixed)

contrib/gis/maps/google/gmap : script() string formating

Reported by: martync Owned by: nobody
Component: GIS Version: 1.5
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

The property named "script" in contrib.gis.maps.google.gmap.GoogleMap has a wrong string formating.
https://github.com/django/django/blob/1.5c2/django/contrib/gis/maps/google/gmap.py#L134-L137

        return format_html('%s\n  <script type="text/javascript">\n//<![CDATA[\n%s//]]>\n  </script>', self.api_script, mark_safe(self.js))

while it should be :

        return format_html('{0}\n  <script type="text/javascript">\n//<![CDATA[\n{1}//]]>\n  </script>', self.api_script, mark_safe(self.js))

I have created a pull request for this bug : https://github.com/django/django/pull/1379
I will write a testcase.

Change History (4)

comment:1 Changed 21 months ago by mjtamlyn

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Ready for checkin

comment:2 Changed 21 months ago by Claude Paroz <claude@…>

  • Resolution set to fixed
  • Status changed from new to closed

In 27c1a7257652031d3957c97271723778f27c4d7b:

Fixed #20773 -- [gis] Fixed regression in GoogleMap output

Thanks Martyn Clement for the report and the initial patch.

comment:3 Changed 21 months ago by Claude Paroz <claude@…>

In 92f66a613498172e6300c8a0b57513183e998597:

[1.6.x] Fixed #20773 -- [gis] Fixed regression in GoogleMap output

Thanks Martyn Clement for the report and the initial patch.
Backport of 27c1a7257 from master.

comment:4 Changed 21 months ago by Claude Paroz <claude@…>

In 01910115329c2073e6c68b214155dd5fb87132c8:

[1.5.x] Fixed #20773 -- [gis] Fixed regression in GoogleMap output

Thanks Martyn Clement for the report and the initial patch.
Backport of 27c1a7257 from master.

Note: See TracTickets for help on using tickets.
Back to Top