Fix syncers.
This metaclass only works when creating instances of a class,
not when they are used directly as classes.
@@ -5,14 +5,13 @@ using Django settings.
"""
+from django.conf import settings
+from django.utils.module_loading import import_string
+
from readthedocs.core.utils.extend import SettingsOverrideObject
from readthedocs.privacy import backend
-# Managers
-from readthedocs.privacy.backends import syncers
-
-
class ProjectQuerySet(SettingsOverrideObject):
_default_class = backend.ProjectQuerySet
_override_setting = 'PROJECT_MANAGER'
@@ -56,6 +55,5 @@ class AdminPermission(SettingsOverrideObject):
# Syncers
-class Syncer(SettingsOverrideObject):
- _default_class = syncers.LocalSyncer
- _override_setting = 'FILE_SYNCER'
+Syncer = import_string(getattr(settings, 'FILE_SYNCER',
+ 'readthedocs.privacy.backends.syncers.LocalSyncer'))
