Browse Source

[FIX] auth_brute_force: Don't error on migrations

Migrating from v9 will fail as that version doesn't have the 10.0.1.0.0 data structure
pull/1441/head
Pedro M. Baeza 6 years ago
committed by GitHub
parent
commit
d11a8b103a
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      auth_brute_force/migrations/10.0.2.0.0/pre-migrate.py

4
auth_brute_force/migrations/10.0.2.0.0/pre-migrate.py

@ -8,6 +8,10 @@ from psycopg2 import IntegrityError
def migrate(cr, version): def migrate(cr, version):
if not version: if not version:
return return
# Don't act when coming from version 9
cr.execute("SELECT 1 FROM pg_class WHERE relname = 'res_banned_remote'")
if not cr.fetchone():
return
# Fix typo across DB # Fix typo across DB
cr.execute( cr.execute(
""" UPDATE res_authentication_attempt """ UPDATE res_authentication_attempt

Loading…
Cancel
Save