| Total Complexity | 3 |
| Total Lines | 18 |
| Duplicated Lines | 0 % |
| Changes | 5 | ||
| Bugs | 1 | Features | 0 |
| 1 | from django.apps import AppConfig |
||
| 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_compat import JSONField, register_app |
||
| 19 | except ImportError: |
||
| 20 | raise ImproperlyConfigured( |
||
| 21 | 'You must have django-jsonfield and django-jsonfield-compat ' |
||
| 22 | 'installed if you wish to use a JSONField on your actions' |
||
| 23 | ) |
||
| 24 | JSONField(blank=True, null=True).contribute_to_class(action_class, 'data') |
||
| 25 | register_app(self) |
||
| 26 |