Projet

Général

Profil

0001-misc-make-sure-.wipe-is-only-called-on-classes-43651.patch

Frédéric Péters, 30 septembre 2022 13:30

Télécharger (1,49 ko)

Voir les différences:

Subject: [PATCH] misc: make sure .wipe() is only called on classes (#43651)

 wcs/qommon/storage.py | 1 +
 wcs/sql.py            | 2 ++
 2 files changed, 3 insertions(+)
wcs/qommon/storage.py
1071 1071

  
1072 1072
    @classmethod
1073 1073
    def wipe(cls):
1074
        assert isinstance(cls, type)
1074 1075
        tmpdir = tempfile.mkdtemp(prefix='wiping', dir=os.path.join(get_publisher().app_dir))
1075 1076
        dirs_to_move = []
1076 1077
        objects_dir = cls.get_objects_dir()
wcs/sql.py
2467 2467
    @classmethod
2468 2468
    @guard_postgres
2469 2469
    def wipe(cls, drop=False, clause=None):
2470
        assert isinstance(cls, type)
2470 2471
        conn, cur = get_connection_and_cursor()
2471 2472
        sql_statement = '''DELETE FROM %s''' % cls._table_name
2472 2473
        parameters = {}
......
3045 3046
    @classmethod
3046 3047
    @guard_postgres
3047 3048
    def wipe(cls, drop=False):
3049
        assert isinstance(cls, type)
3048 3050
        conn, cur = get_connection_and_cursor()
3049 3051
        if drop:
3050 3052
            cur.execute('''DROP TABLE %s_evolutions CASCADE''' % cls._table_name)
3051
-