API & Client - fix missiing translation on api error

This commit is contained in:
Sam 2021-11-03 09:48:24 +01:00
parent fece99921b
commit c683401daa
11 changed files with 15 additions and 13 deletions

View File

@ -1 +1 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><!--[if IE]><link rel="icon" href="/favicon.ico"><![endif]--><link rel="stylesheet" href="/static/css/fork-awesome.min.css"><link rel="stylesheet" href="/static/css/leaflet.css"><title>FitTrackee</title><link href="/static/css/admin.27bf6ef5.css" rel="prefetch"><link href="/static/css/main.18c88976.css" rel="prefetch"><link href="/static/css/main~workouts.dec22e70.css" rel="prefetch"><link href="/static/css/profile.8c004342.css" rel="prefetch"><link href="/static/css/reset.0a21856c.css" rel="prefetch"><link href="/static/css/workouts.45fb3086.css" rel="prefetch"><link href="/static/js/admin.ae6123c4.js" rel="prefetch"><link href="/static/js/chunk-2d0c9189.c81458cc.js" rel="prefetch"><link href="/static/js/chunk-2d0cf391.020c75ea.js" rel="prefetch"><link href="/static/js/chunk-2d0da8f3.c8c3e7e8.js" rel="prefetch"><link href="/static/js/chunk-2d2248b6.d84473c1.js" rel="prefetch"><link href="/static/js/chunk-2d22523a.4b710d99.js" rel="prefetch"><link href="/static/js/main.308f7e1a.js" rel="prefetch"><link href="/static/js/main~workouts.896585f2.js" rel="prefetch"><link href="/static/js/profile.998bc0bd.js" rel="prefetch"><link href="/static/js/reset.624f741d.js" rel="prefetch"><link href="/static/js/workouts.13789396.js" rel="prefetch"><link href="/static/css/app.4717d662.css" rel="preload" as="style"><link href="/static/js/app.dad9d7e0.js" rel="preload" as="script"><link href="/static/js/chunk-vendors.61765c73.js" rel="preload" as="script"><link href="/static/css/app.4717d662.css" rel="stylesheet"><link rel="icon" type="image/png" sizes="32x32" href="/img/icons/favicon-32x32.png"><link rel="icon" type="image/png" sizes="16x16" href="/img/icons/favicon-16x16.png"><link rel="manifest" href="/manifest.json"><meta name="theme-color" content="#4DBA87"><meta name="apple-mobile-web-app-capable" content="no"><meta name="apple-mobile-web-app-status-bar-style" content="default"><meta name="apple-mobile-web-app-title" content="fittrackee_client"><link rel="apple-touch-icon" href="/img/icons/apple-touch-icon-152x152.png"><link rel="mask-icon" href="/img/icons/safari-pinned-tab.svg" color="#4DBA87"><meta name="msapplication-TileImage" content="/img/icons/msapplication-icon-144x144.png"><meta name="msapplication-TileColor" content="#000000"></head><body><noscript><strong>We're sorry but FitTrackee doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="/static/js/chunk-vendors.61765c73.js"></script><script src="/static/js/app.dad9d7e0.js"></script></body></html>
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><!--[if IE]><link rel="icon" href="/favicon.ico"><![endif]--><link rel="stylesheet" href="/static/css/fork-awesome.min.css"><link rel="stylesheet" href="/static/css/leaflet.css"><title>FitTrackee</title><link href="/static/css/admin.27bf6ef5.css" rel="prefetch"><link href="/static/css/main.18c88976.css" rel="prefetch"><link href="/static/css/main~workouts.dec22e70.css" rel="prefetch"><link href="/static/css/profile.8c004342.css" rel="prefetch"><link href="/static/css/reset.0a21856c.css" rel="prefetch"><link href="/static/css/workouts.45fb3086.css" rel="prefetch"><link href="/static/js/admin.ae6123c4.js" rel="prefetch"><link href="/static/js/chunk-2d0c9189.c81458cc.js" rel="prefetch"><link href="/static/js/chunk-2d0cf391.020c75ea.js" rel="prefetch"><link href="/static/js/chunk-2d0da8f3.c8c3e7e8.js" rel="prefetch"><link href="/static/js/chunk-2d2248b6.d84473c1.js" rel="prefetch"><link href="/static/js/chunk-2d22523a.4b710d99.js" rel="prefetch"><link href="/static/js/main.308f7e1a.js" rel="prefetch"><link href="/static/js/main~workouts.896585f2.js" rel="prefetch"><link href="/static/js/profile.998bc0bd.js" rel="prefetch"><link href="/static/js/reset.624f741d.js" rel="prefetch"><link href="/static/js/workouts.13789396.js" rel="prefetch"><link href="/static/css/app.4717d662.css" rel="preload" as="style"><link href="/static/js/app.fba56819.js" rel="preload" as="script"><link href="/static/js/chunk-vendors.61765c73.js" rel="preload" as="script"><link href="/static/css/app.4717d662.css" rel="stylesheet"><link rel="icon" type="image/png" sizes="32x32" href="/img/icons/favicon-32x32.png"><link rel="icon" type="image/png" sizes="16x16" href="/img/icons/favicon-16x16.png"><link rel="manifest" href="/manifest.json"><meta name="theme-color" content="#4DBA87"><meta name="apple-mobile-web-app-capable" content="no"><meta name="apple-mobile-web-app-status-bar-style" content="default"><meta name="apple-mobile-web-app-title" content="fittrackee_client"><link rel="apple-touch-icon" href="/img/icons/apple-touch-icon-152x152.png"><link rel="mask-icon" href="/img/icons/safari-pinned-tab.svg" color="#4DBA87"><meta name="msapplication-TileImage" content="/img/icons/msapplication-icon-144x144.png"><meta name="msapplication-TileColor" content="#000000"></head><body><noscript><strong>We're sorry but FitTrackee doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="/static/js/chunk-vendors.61765c73.js"></script><script src="/static/js/app.fba56819.js"></script></body></html>

View File

@ -64,7 +64,7 @@ self.__precacheManifest = (self.__precacheManifest || []).concat([
"url": "/img/workouts/mountains.svg"
},
{
"revision": "9623aa1a1c19a881086977a3edfc1145",
"revision": "f75f8df3621aa692bd0f287b779f98b7",
"url": "/index.html"
},
{
@ -80,7 +80,7 @@ self.__precacheManifest = (self.__precacheManifest || []).concat([
"url": "/static/css/admin.27bf6ef5.css"
},
{
"revision": "6b46b4d95a705ed57b97",
"revision": "e370f660b4615a7b1407",
"url": "/static/css/app.4717d662.css"
},
{
@ -196,8 +196,8 @@ self.__precacheManifest = (self.__precacheManifest || []).concat([
"url": "/static/js/admin.ae6123c4.js"
},
{
"revision": "6b46b4d95a705ed57b97",
"url": "/static/js/app.dad9d7e0.js"
"revision": "e370f660b4615a7b1407",
"url": "/static/js/app.fba56819.js"
},
{
"revision": "bd7d183c9f68e5f4027d",

View File

@ -14,7 +14,7 @@
importScripts("https://storage.googleapis.com/workbox-cdn/releases/4.3.1/workbox-sw.js");
importScripts(
"/precache-manifest.044e624348389b8946ac9a1756fae04a.js"
"/precache-manifest.aab9327d959797e12b9f2af90df626c8.js"
);
workbox.core.setCacheNameDetails({prefix: "fittrackee_client"});

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1038,7 +1038,7 @@ class TestDeleteUser(ApiTestCaseMixin):
assert response.status_code == 403
assert 'error' in data['status']
assert (
'You can not delete your account, no other user has admin rights.'
'you can not delete your account, no other user has admin rights'
in data['message']
)

View File

@ -532,7 +532,7 @@ def delete_user(
- invalid token, please log in again
:statuscode 403:
- you do not have permissions
- You can not delete your account, no other user has admin rights.
- you can not delete your account, no other user has admin rights
:statuscode 404:
- user does not exist
:statuscode 500: error, please try again or contact the administrator
@ -551,8 +551,8 @@ def delete_user(
and User.query.filter_by(admin=True).count() == 1
):
return ForbiddenErrorResponse(
'You can not delete your account, '
'no other user has admin rights.'
'you can not delete your account, '
'no other user has admin rights'
)
for workout in Workout.query.filter_by(user_id=user.id).all():

View File

@ -24,6 +24,7 @@
"successfully registered": "Successfully registered.",
"user does not exist": "User does not exist.",
"username: 3 to 12 characters required": "Username: 3 to 12 characters required.",
"you can not delete your account, no other user has admin rights": "You can not delete your account, no other user has admin rights.",
"you do not have permissions": "You do not have permissions."
},
"PAGINATION": {

View File

@ -24,6 +24,7 @@
"successfully registered": "Inscription validée.",
"user does not exist": "L'utilisateur n'existe pas",
"username: 3 to 12 characters required": "Nom d'utilisateur : 3 à 12 caractères requis.",
"you can not delete your account, no other user has admin rights": "Vous ne pouvez pas supprimer votre compte, aucun autre utilisateur n'a des droits d'administration.",
"you do not have permissions": "Vous n'avez pas les permissions nécessaires."
},
"PAGINATION": {