|
20 | 20 |
|
21 | 21 | # Ticket-video integration: plugin URLs are auto-included via plugin handler below. |
22 | 22 | from eventyay.config.urls import common_patterns |
23 | | -from eventyay.multidomain import redirects |
24 | 23 | from eventyay.multidomain.plugin_handler import plugin_event_urls |
25 | 24 | from eventyay.presale.urls import ( |
26 | 25 | event_patterns, |
|
32 | 31 | WEBAPP_DIST_DIR = os.path.normpath(os.path.join(BASE_DIR, 'static', 'webapp')) |
33 | 32 | logger = logging.getLogger(__name__) |
34 | 33 |
|
35 | | -EXCLUDED_LEGACY_PREFIXES = ( |
36 | | - "common", |
37 | | - "control", |
38 | | - "orga", |
39 | | - "admin", |
40 | | - "api", |
41 | | - "video", |
42 | | - "static", |
43 | | - "media", |
44 | | -) |
45 | | - |
46 | | -MATCHED_LEGACY_SUBPATHS = ( |
47 | | - "schedule", |
48 | | - "talk", |
49 | | - "speaker", |
50 | | - "featured", |
51 | | - "sneak", |
52 | | - "cfp", |
53 | | - "submit", |
54 | | - "me", |
55 | | - "login", |
56 | | - "logout", |
57 | | - "auth", |
58 | | - "reset", |
59 | | - "invitation", |
60 | | - "online-video", |
61 | | - "widgets", |
62 | | - "static", |
63 | | - "locale", |
64 | | - "sw\\.js", |
65 | | -) |
66 | | - |
67 | | -EXCLUDED_LEGACY_PREFIXES_REGEX = "|".join(EXCLUDED_LEGACY_PREFIXES) |
68 | | -MATCHED_LEGACY_SUBPATHS_REGEX = "|".join(MATCHED_LEGACY_SUBPATHS) |
69 | 34 |
|
70 | 35 | class VideoSPAView(View): |
71 | 36 | def get(self, request, *args, **kwargs): |
@@ -270,44 +235,12 @@ def get(self, request, path='', *args, **kwargs): |
270 | 235 | ), |
271 | 236 | ] |
272 | 237 |
|
273 | | -# Legacy redirect patterns for backward compatibility |
274 | | -legacy_redirect_patterns = [ |
275 | | - # Legacy standalone video SPA at /video |
276 | | - re_path(r'^video/assets/(?P<path>.*)$', VideoAssetView.as_view(), name='video.legacy.assets'), |
277 | | - re_path( |
278 | | - r'^video/(?P<path>[^?]*\.[a-zA-Z0-9._-]+)$', |
279 | | - VideoAssetView.as_view(), |
280 | | - name='video.legacy.assets.file', |
281 | | - ), |
282 | | - re_path(r'^video/?$', VideoSPAView.as_view(), name='video.legacy.index'), |
283 | | - # Legacy video URLs: /video/<event_identifier> -> /{organizer}/{event}/video |
284 | | - re_path( |
285 | | - r'^video/(?P<event_identifier>(?!assets)[^/]+)(?:/.*)?$', |
286 | | - redirects.legacy_video_redirect, |
287 | | - name='video.legacy.redirect', |
288 | | - ), |
289 | | - # Legacy talk URLs: /<event>/(path) -> /{organizer}/{event}/(path) |
290 | | - # This excludes known top-level namespaces before treating the first segment as an event slug. |
291 | | - re_path( |
292 | | - rf'^(?!(?:{EXCLUDED_LEGACY_PREFIXES_REGEX})/)(?P<event_slug>[^/]+)/({MATCHED_LEGACY_SUBPATHS_REGEX})(?:/|$)', |
293 | | - redirects.legacy_talk_redirect, |
294 | | - name='talk.legacy.redirect', |
295 | | - ), |
296 | | - # Legacy event base URL: /<event>/ -> /{organizer}/{event}/ |
297 | | - re_path( |
298 | | - rf'^(?!(?:{EXCLUDED_LEGACY_PREFIXES_REGEX})/)(?P<event_slug>[^/]+)/$', |
299 | | - redirects.legacy_talk_redirect, |
300 | | - name='talk.legacy.base.redirect', |
301 | | - ), |
302 | | -] |
303 | | - |
304 | 238 | urlpatterns = ( |
305 | 239 | common_patterns |
306 | 240 | + storage_patterns |
307 | | - # The plugins patterns must be before legacy_redirect_patterns and presale_patterns_main |
| 241 | + # The plugins patterns must be before presale_patterns_main |
308 | 242 | # to avoid misdetection of plugin prefixes and organizer/event slugs. |
309 | 243 | + plugin_patterns |
310 | | - + legacy_redirect_patterns |
311 | 244 | + presale_patterns_main |
312 | 245 | + unified_event_patterns |
313 | 246 | ) |
|
0 commit comments