Address RemovedInDjango40Warning

In Django 3.1, django.conf.urls.url() is deprecated
in favor of django.urls.re_path(). For more info see [1]
These were already replaced in Horizon repo by [2].

[1] https://docs.djangoproject.com/en/4.0/releases/3.1/#id2
[2] https://review.opendev.org/c/openstack/horizon/+/827093

Change-Id: I4fe0d9520ad1cb4280a4f8df16fe7ee742ea420a
This commit is contained in:
manchandavishal 2022-04-29 17:42:04 +05:30
parent 26671c6dcd
commit 6b6f058241
3 changed files with 15 additions and 14 deletions

View File

@ -12,14 +12,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from django.conf.urls import url
from django.urls import re_path
from masakaridashboard.hosts import views
HOST = r'^(?P<host_id>[^/]+)/%s$'
urlpatterns = [
url(r'^$', views.IndexView.as_view(), name='index'),
url(HOST % 'detail', views.DetailView.as_view(), name='detail'),
url(HOST % 'update', views.UpdateView.as_view(), name='update'),
re_path(r'^$', views.IndexView.as_view(), name='index'),
re_path(HOST % 'detail', views.DetailView.as_view(), name='detail'),
re_path(HOST % 'update', views.UpdateView.as_view(), name='update'),
]

View File

@ -12,13 +12,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from django.conf.urls import url
from django.urls import re_path
from masakaridashboard.notifications import views
NOTIFICATION = r'^(?P<notification_id>[^/]+)/%s$'
urlpatterns = [
url(r'^$', views.IndexView.as_view(), name='index'),
url(NOTIFICATION % 'detail', views.DetailView.as_view(), name='detail'),
re_path(r'^$', views.IndexView.as_view(), name='index'),
re_path(NOTIFICATION % 'detail', views.DetailView.as_view(),
name='detail'),
]

View File

@ -13,17 +13,17 @@
# License for the specific language governing permissions and limitations
# under the License.
from django.conf.urls import url
from django.urls import re_path
from masakaridashboard.segments import views
SEGMENT = r'^(?P<segment_id>[^/]+)/%s$'
urlpatterns = [
url(r'^$', views.IndexView.as_view(), name='index'),
url(r'^create_segment$', views.CreateSegmentView.as_view(),
name='create_segment'),
url(SEGMENT % 'detail', views.DetailView.as_view(), name='detail'),
url(SEGMENT % 'update', views.UpdateView.as_view(), name='update'),
url(SEGMENT % 'addhost', views.AddHostView.as_view(), name='addhost'),
re_path(r'^$', views.IndexView.as_view(), name='index'),
re_path(r'^create_segment$', views.CreateSegmentView.as_view(),
name='create_segment'),
re_path(SEGMENT % 'detail', views.DetailView.as_view(), name='detail'),
re_path(SEGMENT % 'update', views.UpdateView.as_view(), name='update'),
re_path(SEGMENT % 'addhost', views.AddHostView.as_view(), name='addhost'),
]