Merge lp:~dorian-kemps/unifield-web/US-10141 into lp:unifield-web

Proposed by jftempo
Status: Merged
Merged at revision: 5036
Proposed branch: lp:~dorian-kemps/unifield-web/US-10141
Merge into: lp:unifield-web
Diff against target: 97 lines (+28/-1)
5 files modified
addons/openerp/controllers/templates/database.mako (+5/-0)
addons/openerp/controllers/utils.py (+4/-1)
addons/openerp/po/messages/fr.po (+8/-0)
addons/openerp/static/css/style.css (+7/-0)
addons/openerp/utils/rpc.py (+4/-0)
To merge this branch: bzr merge lp:~dorian-kemps/unifield-web/US-10141
Reviewer Review Type Date Requested Status
UniField Dev Team Pending
Review via email: mp+425394@code.launchpad.net
To post a comment you must log in.
5037. By Dorian

US-10141 [PROGRESS] Login: Added a new message in case the DB isn't correctly restored. Fixed restore warning message

5038. By Dorian

US-10141 [FIX] Login: Added a new message in case the DB isn't correctly restored. Fixed restore warning message

5039. By Dorian

US-10141 [FIX] Login: Fixed translation of restoration message

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'addons/openerp/controllers/templates/database.mako'
2--- addons/openerp/controllers/templates/database.mako 2017-11-24 14:13:57 +0000
3+++ addons/openerp/controllers/templates/database.mako 2022-06-28 11:52:55 +0000
4@@ -69,6 +69,11 @@
5 </table>
6 </div>
7 <hr style="margin: 0 0 !important; background-color: #5A5858;">
8+ %if form.name == 'restore':
9+ <div class="restore_warning">
10+ ${_('You will automatically be redirected to the Login screen after the database is fully restored. Please wait until the process is completed.')}
11+ </div>
12+ %endif
13 <div>${form.display()}</div>
14
15 %if form.name == 'restore':
16
17=== modified file 'addons/openerp/controllers/utils.py'
18--- addons/openerp/controllers/utils.py 2021-02-05 10:07:23 +0000
19+++ addons/openerp/controllers/utils.py 2022-06-28 11:52:55 +0000
20@@ -221,7 +221,10 @@
21 if action == 'login' and login_ret == -4:
22 return login(cherrypy.request.path_info, message=_('A script during patch failed! Login is forbidden for the moment. Please contact your administrator'),
23 db=db, user=user, action=action, origArgs=get_orig_args(kw))
24- if action == 'login' and login_ret in (-5, -7): # must change password
25+ if action == 'login' and login_ret == -8:
26+ return login(cherrypy.request.path_info, message=_('Login refused. The database restoration has failed, please delete it and try again'),
27+ db=db, user=user, action=action, origArgs=get_orig_args(kw))
28+ if action == 'login' and login_ret in (-5, -7): # must change password
29 if 'confirm_password' in kw:
30 message = rpc.session.change_password(db, user, password, kw['new_password'], kw['confirm_password'])
31 if message is not True:
32
33=== modified file 'addons/openerp/po/messages/fr.po'
34--- addons/openerp/po/messages/fr.po 2022-05-09 12:28:10 +0000
35+++ addons/openerp/po/messages/fr.po 2022-06-28 11:52:55 +0000
36@@ -152,6 +152,10 @@
37 msgid "New database name:"
38 msgstr "Nom de la nouvelle base de données :"
39
40+#: controllers/templates/database.mako:72
41+msgid "You will automatically be redirected to the Login screen after the database is fully restored. Please wait until the process is completed."
42+msgstr "Vous serez automatiquement redirigé(e) vers l'écran d'Identification une fois que la base de données sera complètement restaurée. Veuillez attendre que le processus soit entièrement terminé."
43+
44 #: controllers/database.py:69
45 msgid ""
46 "Choose the name of the database that will be created. The name must not "
47@@ -520,6 +524,10 @@
48 msgid "Your IP have been blocked because of too many bad login attempts. It will be unblocked after %s minutes."
49 msgstr "Votre IP à été bloquée à cause d'un trop grand nombre de connexion infructueuses. Elle sera débloquée dans %s minutes."
50
51+#: controllers/utils.py:225
52+msgid "Login refused. The database restoration has failed, please delete it and try again"
53+msgstr "Identification refusée. La restauration de la base de données a échoué, veuillez la supprimer et recommencer"
54+
55 #: controllers/view_log.py:32
56 msgid "ID"
57 msgstr "ID"
58
59=== modified file 'addons/openerp/static/css/style.css'
60--- addons/openerp/static/css/style.css 2020-02-24 15:15:02 +0000
61+++ addons/openerp/static/css/style.css 2022-06-28 11:52:55 +0000
62@@ -639,6 +639,13 @@
63 white-space: nowrap;
64 }
65
66+.restore_warning {
67+ text-align:center;
68+ margin-top:20px;
69+ font-weight: bold;
70+ color: red;
71+}
72+
73 .action-buttons label {
74 display: block;
75 }
76
77=== modified file 'addons/openerp/utils/rpc.py'
78--- addons/openerp/utils/rpc.py 2021-02-05 10:07:23 +0000
79+++ addons/openerp/utils/rpc.py 2022-06-28 11:52:55 +0000
80@@ -148,6 +148,8 @@
81 common.error('PatchFailed', err.code)
82 elif err.code.startswith('AccessDenied'):
83 raise openobject.errors.AccessDenied(err.code, _('Access Denied'))
84+ elif err.code.startswith('BadRestoration'):
85+ common.error('BadRestoration', err.code)
86 else:
87 common.error(_('Application Error'), err.backtrace)
88
89@@ -372,6 +374,8 @@
90 return -5
91 elif e.title == 'PasswordExpired':
92 return -7
93+ elif e.title == 'BadRestoration':
94+ return -8
95 return -1
96
97 if uid <= 0:

Subscribers

People subscribed via source and target branches