diff --git a/server/tests/conftest.py b/server/tests/conftest.py index b8087871..d2b4fbdd 100644 --- a/server/tests/conftest.py +++ b/server/tests/conftest.py @@ -164,7 +164,6 @@ def _clear_db(): @pytest.fixture(autouse=True) -@pytest.mark.django_db async def clear_database(request): if "django_db" not in request.keywords: # pragma: no cover return diff --git a/server/venueless/control/views.py b/server/venueless/control/views.py index 316794c2..c7d1d225 100644 --- a/server/venueless/control/views.py +++ b/server/venueless/control/views.py @@ -182,7 +182,6 @@ class WorldAdminToken(AdminBase, DetailView): success_url = "/control/worlds/" def get(self, request, *args, **kwargs): - base_path = settings.BASE_PATH world = self.get_object() jwt_config = world.config["JWT_secrets"][0] secret = jwt_config["secret"] diff --git a/server/venueless/storage/views.py b/server/venueless/storage/views.py index 77c33ffe..ef2b34d3 100644 --- a/server/venueless/storage/views.py +++ b/server/venueless/storage/views.py @@ -1,5 +1,4 @@ import logging -import re from io import BytesIO from asgiref.sync import async_to_sync @@ -34,7 +33,7 @@ def dispatch(self, request, *args, **kwargs): @cached_property def world(self): - world_id = self.kwargs.get('world_id', None) + world_id = self.kwargs.get("world_id", None) return get_object_or_404(World, id=world_id) @cached_property diff --git a/webapp/config.js b/webapp/config.js index de480f7d..c25bf808 100644 --- a/webapp/config.js +++ b/webapp/config.js @@ -6,8 +6,8 @@ if (ENV_DEVELOPMENT || !window.venueless) { const wsProtocol = window.location.protocol === 'https:' ? 'wss' : 'ws' const httpProtocol = window.location.protocol // Extract the world name from the URL path - const pathSegments = window.location.pathname.split('/'); - const worldName = pathSegments.length > 2 ? pathSegments[2] : 'sample'; + const pathSegments = window.location.pathname.split('/') + const worldName = pathSegments.length > 2 ? pathSegments[2] : 'sample' config = { api: { base: `${httpProtocol}//${hostname}:8443/api/v1/worlds/${worldName}/`, diff --git a/webapp/src/router/index.js b/webapp/src/router/index.js index b1088228..6e59fc4b 100644 --- a/webapp/src/router/index.js +++ b/webapp/src/router/index.js @@ -15,7 +15,6 @@ import ContactRequests from 'views/contact-requests' import Preferences from 'views/preferences' import config from 'config' - Vue.use(VueRouter) const routes = [ @@ -44,7 +43,7 @@ const routes = [ name: 'standalone:anonymous', component: () => import(/* webpackChunkName: "standalone" */ 'views/standalone/anonymous') }] - }, + }, { path: '/rooms/:roomId/presentation/:mode', redirect(to) { @@ -52,9 +51,9 @@ const routes = [ path: `/standalone/${to.params.roomId}/${to.params.mode}` } } - }, + }, { - path: `/:worldName`, + path: '/:worldName', component: App, props: true, children: [ @@ -68,7 +67,7 @@ const routes = [ name: 'home', component: Room }] - }, + }, { path: 'rooms/:roomId', component: RoomHeader, @@ -82,80 +81,80 @@ const routes = [ name: 'room:manage', component: RoomManager }] - }, + }, { path: 'channels/:channelId', name: 'channel', component: Channel, props: true - }, + }, { path: 'schedule', name: 'schedule', component: Schedule - }, + }, { path: 'schedule/talks/:talkId', name: 'schedule:talk', component: Talk, props: true - }, + }, { path: 'sessions', name: 'schedule:sessions', component: Session, props: true - }, + }, { path: 'schedule/speakers', name: 'schedule:speakers', component: Speakers - }, + }, { path: 'schedule/speakers/:speakerId', name: 'schedule:speaker', component: Speaker, props: true - }, + }, { path: 'exhibitors/:exhibitorId', name: 'exhibitor', component: Exhibitor, props: true - }, + }, { path: 'contact-requests', name: 'contactRequests', component: ContactRequests, props: true - }, + }, { path: 'preferences', name: 'preferences', component: Preferences - }, + }, { path: 'posters/:posterId', name: 'poster', component: () => import(/* webpackChunkName: "posters" */ 'views/posters/item'), props: true - }, + }, { path: 'manage-exhibitors', name: 'exhibitors', component: () => import(/* webpackChunkName: "exhibitors" */ 'views/exhibitor-manager') - }, + }, { path: 'manage-exhibitors/:exhibitorId', name: 'exhibitors:exhibitor', component: () => import(/* webpackChunkName: "exhibitors" */ 'views/exhibitor-manager/exhibitor'), props: true - }, + }, { path: 'manage-posters', name: 'posters', component: () => import(/* webpackChunkName: "posters" */ 'views/poster-manager') - }, + }, { path: 'manage-posters/create', name: 'posters:create-poster', @@ -163,45 +162,45 @@ const routes = [ props: { create: true } - }, + }, { path: 'manage-posters/:posterId', name: 'posters:poster', component: () => import(/* webpackChunkName: "posters" */ 'views/poster-manager/poster'), props: true - }, + }, { path: 'admin', name: 'admin', component: () => import(/* webpackChunkName: "admin" */ 'views/admin') - }, + }, { path: 'admin/users', name: 'admin:users', component: () => import(/* webpackChunkName: "admin" */ 'views/admin/users') - }, + }, { path: 'admin/users/:userId', name: 'admin:user', component: () => import(/* webpackChunkName: "admin" */ 'views/admin/user'), props: true - }, + }, { path: 'admin/rooms', name: 'admin:rooms:index', component: () => import(/* webpackChunkName: "admin" */ 'views/admin/rooms/index') - }, + }, { path: 'admin/rooms/new/:type?', name: 'admin:rooms:new', component: () => import(/* webpackChunkName: "admin" */ 'views/admin/rooms/new') - }, + }, { path: 'admin/rooms/:roomId', name: 'admin:rooms:item', component: () => import(/* webpackChunkName: "admin" */ 'views/admin/rooms/item'), props: true - }, + }, { path: 'admin/announcements', name: 'admin:announcements', @@ -212,71 +211,71 @@ const routes = [ component: () => import(/* webpackChunkName: "admin" */ 'views/admin/announcements/item'), props: true }] - }, + }, { path: 'admin/kiosks', name: 'admin:kiosks:index', component: () => import(/* webpackChunkName: "admin" */ 'views/admin/kiosks/index') - }, + }, { path: 'admin/kiosks/new', name: 'admin:kiosks:new', component: () => import(/* webpackChunkName: "admin" */ 'views/admin/kiosks/new') - }, + }, { path: 'admin/kiosks/:kioskId', name: 'admin:kiosks:item', component: () => import(/* webpackChunkName: "admin" */ 'views/admin/kiosks/item'), props: true - }, + }, { path: 'admin/config', component: () => import(/* webpackChunkName: "admin" */ 'views/admin/config'), children: [{ - path: '', - name: 'admin:config', - component: () => import(/* webpackChunkName: "admin" */ 'views/admin/config/main') - }, - { - path: 'schedule', - name: 'admin:config:schedule', - component: () => import(/* webpackChunkName: "admin" */ 'views/admin/config/schedule') - }, - { - path: 'theme', - name: 'admin:config:theme', - component: () => import(/* webpackChunkName: "admin" */ 'views/admin/config/theme') - }, - { - path: 'permissions', - name: 'admin:config:permissions', - component: () => import(/* webpackChunkName: "admin" */ 'views/admin/config/permissions') - }, - { - path: 'token-generator', - name: 'admin:config:token-generator', - component: () => import(/* webpackChunkName: "admin" */ 'views/admin/config/token-generator') - }, - { - path: 'registration', - name: 'admin:config:registration', - component: () => import(/* webpackChunkName: "admin" */ 'views/admin/config/registration') - }, - { - path: 'privacy', - name: 'admin:config:privacy', - component: () => import(/* webpackChunkName: "admin" */ 'views/admin/config/privacy') - }, - { - path: 'audit-log', - name: 'admin:config:audit-log', - component: () => import(/* webpackChunkName: "admin" */ 'views/admin/config/audit-log') - }, - { - path: 'reports', - name: 'admin:config:reports', - component: () => import(/* webpackChunkName: "admin" */ 'views/admin/config/reports') - } + path: '', + name: 'admin:config', + component: () => import(/* webpackChunkName: "admin" */ 'views/admin/config/main') + }, + { + path: 'schedule', + name: 'admin:config:schedule', + component: () => import(/* webpackChunkName: "admin" */ 'views/admin/config/schedule') + }, + { + path: 'theme', + name: 'admin:config:theme', + component: () => import(/* webpackChunkName: "admin" */ 'views/admin/config/theme') + }, + { + path: 'permissions', + name: 'admin:config:permissions', + component: () => import(/* webpackChunkName: "admin" */ 'views/admin/config/permissions') + }, + { + path: 'token-generator', + name: 'admin:config:token-generator', + component: () => import(/* webpackChunkName: "admin" */ 'views/admin/config/token-generator') + }, + { + path: 'registration', + name: 'admin:config:registration', + component: () => import(/* webpackChunkName: "admin" */ 'views/admin/config/registration') + }, + { + path: 'privacy', + name: 'admin:config:privacy', + component: () => import(/* webpackChunkName: "admin" */ 'views/admin/config/privacy') + }, + { + path: 'audit-log', + name: 'admin:config:audit-log', + component: () => import(/* webpackChunkName: "admin" */ 'views/admin/config/audit-log') + }, + { + path: 'reports', + name: 'admin:config:reports', + component: () => import(/* webpackChunkName: "admin" */ 'views/admin/config/reports') + } ] } ] diff --git a/webapp/src/store/schedule.js b/webapp/src/store/schedule.js index 9ce249f6..dac553f6 100644 --- a/webapp/src/store/schedule.js +++ b/webapp/src/store/schedule.js @@ -178,7 +178,7 @@ export default { } }) - return Array.from(languageMap).map(([id, name]) => ({ value: id, label: name })); + return Array.from(languageMap).map(([id, name]) => ({ value: id, label: name })) }, matchesSessionTypeFilter: (state) => (talk, selectedIds) => { if (typeof talk?.session_type === 'string') { diff --git a/webapp/src/theme.js b/webapp/src/theme.js index 0f58179b..174680b9 100644 --- a/webapp/src/theme.js +++ b/webapp/src/theme.js @@ -151,31 +151,31 @@ export function computeForegroundSidebarColor(colors) { } export async function getThemeConfig() { - const themeUrl = config.api.base + 'theme'; - const response = await fetch(themeUrl, { - method: 'GET', - headers: { - 'Content-Type': 'application/json' - } - }); - - let themeConfig; - if (response.ok) { - const data = await response.json(); - themeConfig = { - colors: data.colors || configColors, - logo: Object.assign({}, DEFAULT_LOGO, data.logo), - streamOfflineImage: data.streamOfflineImage, - identicons: Object.assign({}, DEFAULT_IDENTICONS, data.identicons), - }; - } else { - console.error("Failed to fetch theme config, set default:", response.statusText); - themeConfig = { - colors: configColors, - logo: Object.assign({}, DEFAULT_LOGO, config.theme?.logo), - streamOfflineImage: config.theme?.streamOfflineImage, - identicons: Object.assign({}, DEFAULT_IDENTICONS, config.theme?.identicons), - }; - } - return themeConfig; + const themeUrl = config.api.base + 'theme' + const response = await fetch(themeUrl, { + method: 'GET', + headers: { + 'Content-Type': 'application/json' + } + }) + + let themeConfig + if (response.ok) { + const data = await response.json() + themeConfig = { + colors: data.colors || configColors, + logo: Object.assign({}, DEFAULT_LOGO, data.logo), + streamOfflineImage: data.streamOfflineImage, + identicons: Object.assign({}, DEFAULT_IDENTICONS, data.identicons), + } + } else { + console.error('Failed to fetch theme config, set default:', response.statusText) + themeConfig = { + colors: configColors, + logo: Object.assign({}, DEFAULT_LOGO, config.theme?.logo), + streamOfflineImage: config.theme?.streamOfflineImage, + identicons: Object.assign({}, DEFAULT_IDENTICONS, config.theme?.identicons), + } + } + return themeConfig } diff --git a/webapp/src/views/schedule/speakers/item.vue b/webapp/src/views/schedule/speakers/item.vue index 0227abc1..34b7fbd3 100644 --- a/webapp/src/views/schedule/speakers/item.vue +++ b/webapp/src/views/schedule/speakers/item.vue @@ -65,8 +65,8 @@ export default { mounted() {}, methods: { generateSessionLinkUrl(sessionData) { - const publicPath = process.env.BASE_URL || '/video/'; - return `${publicPath}schedule/talks/${sessionData.session.id}`; + const publicPath = process.env.BASE_URL || '/video/' + return `${publicPath}schedule/talks/${sessionData.session.id}` } } }