Total Complexity | 3 |
Total Lines | 15 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | from django.core.exceptions import ImproperlyConfigured |
||
9 | class ActstreamConfig(AppConfig): |
||
10 | name = 'actstream' |
||
11 | |||
12 | def ready(self): |
||
13 | from actstream.actions import action_handler |
||
14 | action.connect(action_handler, dispatch_uid='actstream.models') |
||
15 | action_class = self.get_model('action') |
||
16 | |||
17 | if settings.USE_JSONFIELD: |
||
18 | try: |
||
19 | from jsonfield.fields import JSONField |
||
20 | except ImportError: |
||
21 | raise ImproperlyConfigured('You must have django-jsonfield installed ' |
||
22 | 'if you wish to use a JSONField on your actions') |
||
23 | JSONField(blank=True, null=True).contribute_to_class(action_class, 'data') |
||
24 |