summaryrefslogtreecommitdiffstats
path: root/askbot/deployment/assertions.py
blob: d8dee828f824025277d4ae1f1cc954e7df2da05c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
"""assertions regarding deployment of askbot
todo: move here stuff from startup_procedures.py

the reason - some assertions need to be run in askbot/__init__
as opposed to startup_procedures.py - which are executed in the 
beginning of the models module
"""
from askbot.deployment import package_utils
from askbot.exceptions import DeploymentError

def assert_package_compatibility():
    """raises an exception if any known incompatibilities 
    are found
    """
    (django_major, django_minor, django_micro) = \
        package_utils.get_django_version()
    if django_major < 1:
        raise DeploymentError('Django version < 1.0 is not supported by askbot')

    coffin_version = package_utils.get_coffin_version()
    if coffin_version == (0, 3, 0) and django_major == 1 and django_minor > 1:
        raise DeploymentError(
            'Coffin package version 0.3 is not compatible '
            'with the current version of Django, please upgrade '
            'coffin to at least 0.3.3'
        )