Skip to content
Snippets Groups Projects
Verified Commit 8b66a7c4 authored by Antoine R. Dumont's avatar Antoine R. Dumont
Browse files

deposit.urls: Retro-compatibility fix about import and type conflict

We now type this module with django version which allows us to.

This fixes the debian buster build [1]

[1] https://jenkins.softwareheritage.org/job/debian/job/packages/job/DDEP/job/gbp-buildpackage/94/consoleFull

Closes T3072
parent ce5c76c7
No related branches found
No related tags found
1 merge request!218deposit.urls: Retro-compatibility fix about import and type conflict
# Copyright (C) 2017-2019 The Software Heritage developers
# Copyright (C) 2017-2021 The Software Heritage developers
# See the AUTHORS file at the top-level directory of this distribution
# License: GNU General Public License version 3, or any later version
# See top-level LICENSE file for more information
......@@ -6,15 +6,24 @@
"""SWH's main deposit URL Configuration
"""
from __future__ import annotations
from typing import Sequence, Union
from django.conf.urls import include, url
from django.shortcuts import render
from django.urls import URLPattern, URLResolver
from django.views.generic.base import RedirectView
from rest_framework.urlpatterns import format_suffix_patterns
try:
from django.urls import URLPattern, URLResolver
except ImportError:
# retro-compatibility workaround, django 1.11.29 [1] does not expose the previous
# module, so we fallback to no typing for such version.
# [1] django debian stable version: 1:1.11.29-1~deb10u1
pass
favicon_view = RedirectView.as_view(
url="/static/img/icons/swh-logo-32x32.png", permanent=True
)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment