GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

MigrationBase.apply()   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %
Metric Value
cc 1
dl 0
loc 5
rs 9.4286
1
import transaction
2
3
4
class MigrationBase(object):
5
    def __init__(self, root):
6
        self.root = root
7
8
    @classmethod
9
    def is_applicable(cls, root):
10
        return getattr(root, '_db_version', 0) < cls.DB_VERSION
11
12
    def set_version(self):
13
        self.root._db_version = self.DB_VERSION
14
15
    def apply(self):
16
        transaction.begin()
17
        self.forward()
18
        self.set_version()
19
        transaction.commit()
20