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

Proposed by jftempo
Status: Merged
Merged at revision: 6263
Proposed branch: lp:~dorian-kemps/unifield-server/US-10141
Merge into: lp:unifield-server
Diff against target: 42 lines (+9/-5)
2 files modified
bin/service/security.py (+8/-4)
bin/service/web_services.py (+1/-1)
To merge this branch: bzr merge lp:~dorian-kemps/unifield-server/US-10141
Reviewer Review Type Date Requested Status
UniField Reviewer Team Pending
Review via email: mp+425387@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/service/security.py'
2--- bin/service/security.py 2021-02-05 15:05:10 +0000
3+++ bin/service/security.py 2022-06-28 10:18:28 +0000
4@@ -27,6 +27,7 @@
5 from passlib.hash import bcrypt
6 from tools.translate import _
7 from osv import osv
8+from psycopg2._psycopg import ProgrammingError
9 PASSWORD_MIN_LENGHT = 8
10
11 # When rejecting a password, hide the traceback
12@@ -49,10 +50,13 @@
13 if pooler.pool_dic[cr.dbname]._ready:
14 return False
15 ready = False
16- cr.execute("select count(id) from ir_module_module where state in ('to install', 'to upgrade')")
17- n = cr.fetchone()
18- if n and n[0]:
19- return n[0]
20+ try:
21+ cr.execute("select count(id) from ir_module_module where state in ('to install', 'to upgrade')")
22+ n = cr.fetchone()
23+ if n and n[0]:
24+ return n[0]
25+ except ProgrammingError:
26+ raise Exception("BadRestoration: The table ir_module_module is missing")
27 if not ready:
28 # when loading the trans. modules are installed but db is not ready
29 return True
30
31=== modified file 'bin/service/web_services.py'
32--- bin/service/web_services.py 2020-03-10 13:14:15 +0000
33+++ bin/service/web_services.py 2022-06-28 10:18:28 +0000
34@@ -364,7 +364,7 @@
35
36 self._create_empty_database(db_name)
37
38- cmd = ['pg_restore', '--no-owner', '--no-acl', '-n', 'public']
39+ cmd = ['pg_restore', '--no-owner', '--no-acl', '-n', 'public', '--single-transaction']
40 if tools.config['db_user']:
41 cmd.append('--username=' + tools.config['db_user'])
42 if tools.config['db_host']:

Subscribers

People subscribed via source and target branches