First step towards a MediaManager class: Compat one.

To get us moving towards a MediaManager class, the first
idea is to create a class that wraps our current dict based
manager and makes all users happy.
This commit is contained in:
Elrond
2013-03-08 14:37:33 +01:00
parent 827f91e603
commit 2077d6ed93
3 changed files with 32 additions and 4 deletions

View File

@@ -212,7 +212,7 @@ class MediaEntryMixin(GenerateSlugMixin):
# than iterating through all media managers.
for media_type, manager in get_media_managers():
if media_type == self.media_type:
return manager
return manager(self)
# Not found? Then raise an error
raise FileTypeNotSupported(
"MediaManager not in enabled types. Check media_types in config?")