mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
Refs #25916 -- Removed SitemapIndexItem.__str__() per deprecation timeline.
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import datetime
|
||||
import warnings
|
||||
from dataclasses import dataclass
|
||||
from functools import wraps
|
||||
|
||||
@@ -9,7 +8,6 @@ from django.http import Http404
|
||||
from django.template.response import TemplateResponse
|
||||
from django.urls import reverse
|
||||
from django.utils import timezone
|
||||
from django.utils.deprecation import RemovedInDjango50Warning
|
||||
from django.utils.http import http_date
|
||||
|
||||
|
||||
@@ -18,15 +16,6 @@ class SitemapIndexItem:
|
||||
location: str
|
||||
last_mod: bool = None
|
||||
|
||||
# RemovedInDjango50Warning
|
||||
def __str__(self):
|
||||
msg = (
|
||||
"Calling `__str__` on SitemapIndexItem is deprecated, use the `location` "
|
||||
"attribute instead."
|
||||
)
|
||||
warnings.warn(msg, RemovedInDjango50Warning, stacklevel=2)
|
||||
return self.location
|
||||
|
||||
|
||||
def x_robots_tag(func):
|
||||
@wraps(func)
|
||||
|
||||
Reference in New Issue
Block a user