Opened 8 years ago

Closed 8 years ago

#27842 closed New feature (fixed)

Add protocol argument to GenericSitemap.__init__()

Reported by: chex Owned by: chex
Component: contrib.sitemaps Version: 1.10
Severity: Normal Keywords: sitemaps genericsitemap
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description (last modified by chex)

django.contrib.sitemaps.GenericSitemap doesn't accept "protocol" in initial args or kwargs.

some_sitemap = GenericSitemap(
      info_dict={
            'queryset': SomeModel.objects.all(),
        },
        priority=0.6,
        changefreq='yearly',
    )
some_sitemap.protocol = 'https'


GenericSitemap source
Why not to pass protocol as keyword argument?

some_sitemap = GenericSitemap(
      info_dict={
            'queryset': SomeModel.objects.all(),
        },
        priority=0.6,
        changefreq='yearly',
        protocol='https',
    )

Change History (14)

comment:1 by chex, 8 years ago

Description: modified (diff)

comment:2 by chex, 8 years ago

Owner: changed from nobody to chex
Status: newassigned

comment:3 by chex, 8 years ago

Description: modified (diff)

comment:5 by chex, 8 years ago

Has patch: set

comment:6 by Tim Graham, 8 years ago

Needs documentation: set
Needs tests: set
Triage Stage: UnreviewedAccepted
Type: UncategorizedNew feature

Looks okay at first glance. Documentation and tests are also required.

comment:7 by chex, 8 years ago

Update PR with tests.

comment:8 by Tim Graham, 8 years ago

And documentation? Please update the ticket flags when you update the patch. It looks like the tests are testing more than just what's changed. It's fine to increase test coverage but please do it in a separate commit (perhaps a separate PR that precedes this one).

comment:9 by chex, 8 years ago

Needs tests: unset

comment:10 by chex, 8 years ago

Needs documentation: unset

Update pr with documentation.
Non specific to the ticket tests are moved to another pr.

comment:11 by chex, 8 years ago

Description: modified (diff)

comment:12 by chex, 8 years ago

Description: modified (diff)

comment:13 by Tim Graham, 8 years ago

Summary: class GenericSitemap doesn't handle "protocol" in __init__Add protocol argument to GenericSitemap.__init__()
Triage Stage: AcceptedReady for checkin

comment:14 by Tim Graham <timograham@…>, 8 years ago

Resolution: fixed
Status: assignedclosed

In 9f21e35:

Fixed #27842 -- Added protocol kwarg to GenericSitemap.init().

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