🚨 Fixed deepsource issues

This commit is contained in:
Mawoka
2023-06-30 18:55:13 +02:00
parent 3a2ab6c64b
commit 3e6e367ed0
10 changed files with 9 additions and 10 deletions
-1
View File
@@ -128,7 +128,6 @@ async def meilisearch_init():
for i in meilisearch.index(settings.meilisearch_index).get_stats():
number_of_docs = i[1]["numberOfDocuments"]
break
# if meilisearch.index(settings.meilisearch_index).get_stats()["numberOfDocuments"] != quiz_count:
if number_of_docs != quiz_count:
print("MeiliSearch and Database got out of sync, syncthing them")
meilisearch.delete_index(settings.meilisearch_index)
+1 -1
View File
@@ -28,7 +28,7 @@ module.exports = {
// Put a blank string as initial translation
// (useful for Weblate be marked as 'not yet translated', see later)
defaultValue: (lng, ns, key) => '',
defaultValue: () => '',
// Location of translation files
resource: {
+1 -2
View File
@@ -37,8 +37,7 @@ export const getWinnersSorted = (
if (q_res === null) {
continue;
}
for (let j = 0; j < q_res.length; j++) {
const res = q_res[j];
for (const res of q_res) {
if (res['right']) {
if (winners[res['username']] === undefined) {
winners[res['username']] = 0;
@@ -29,6 +29,7 @@ export class I18NextTranslationService implements TranslationService {
// 2. Create a new set function that changes the i18n locale.
// 3. Create a new update function that changes the i18n locale.
// 4. Return modified writable.
// skipcq: JS-0105
private createLocale(i18n: I18nService) {
const { subscribe, set, update } = writable<string>(i18n.i18n.language);
+1 -1
View File
@@ -6,7 +6,7 @@
import { signedIn } from '$lib/stores';
import type { LayoutLoad } from './$types';
export const load: LayoutLoad = async ({ data }) => {
export const load: LayoutLoad = ({ data }) => {
const { email } = data;
if (email) {
signedIn.set(true);
@@ -2,7 +2,7 @@
//
// SPDX-License-Identifier: MPL-2.0
export async function load({ url }) {
export function load({ url }) {
const error = url.searchParams.get('error');
return {
error
@@ -2,7 +2,7 @@
//
// SPDX-License-Identifier: MPL-2.0
export async function load({ url }) {
export function load({ url }) {
const token = url.searchParams.get('token');
return {
+1 -1
View File
@@ -18,6 +18,6 @@ export async function load({ parent, url }) {
return {
game_pin: pin === null ? '' : pin,
game_token: token === null ? '' : token,
auto_connect: auto_connect
auto_connect
};
}
+1 -1
View File
@@ -4,7 +4,7 @@
import type { RequestHandler } from '@sveltejs/kit';
export const GET: RequestHandler = async () => {
export const GET: RequestHandler = () => {
return new Response(undefined, {
status: 301,
headers: {
@@ -13,7 +13,7 @@ export const load = async ({ params, parent }) => {
} else if (res.status === 200) {
const quiz = await res.json();
return {
quiz: quiz,
quiz,
logged_in: Boolean(email)
};
} else {