Completed
Pull Request — master (#300)
by
unknown
01:12
created

fixed_last_executed_query()   A

Complexity

Conditions 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 5
rs 9.4285
cc 1
1
from django.core.exceptions import ImproperlyConfigured
2
3
from actstream import settings
4
from actstream.compat_apps import AppConfig
5
from actstream.signals import action
6
7
8
class ActstreamConfig(AppConfig):
9
    name = 'actstream'
10
11
    def ready(self):
12
        from actstream.actions import action_handler
13
        action.connect(action_handler, dispatch_uid='actstream.models')
14
        action_class = self.get_model('action')
15
16
        if settings.USE_JSONFIELD:
17
            try:
18
                from jsonfield.fields import JSONField
19
            except ImportError:
20
                raise ImproperlyConfigured('You must have django-jsonfield installed '
21
                                           'if you wish to use a JSONField on your actions')
22
            JSONField(blank=True, null=True).contribute_to_class(action_class, 'data')
23