diff options
author | Sebastian Spaeth <Sebastian@SSpaeth.de> | 2012-11-26 14:55:33 +0100 |
---|---|---|
committer | Sebastian Spaeth <Sebastian@SSpaeth.de> | 2012-11-30 14:31:43 +0100 |
commit | 138a18fd6ed18b7415bc3bdcf9c0300c3d6a8c85 (patch) | |
tree | b9ec8486b8807383a810ddd2a010d727ec79aded /mediagoblin/db/mixin.py | |
parent | 8e5fae9b437afced1f8b55a44565c5032b8e7424 (diff) | |
download | mediagoblin-138a18fd6ed18b7415bc3bdcf9c0300c3d6a8c85.tar.lz mediagoblin-138a18fd6ed18b7415bc3bdcf9c0300c3d6a8c85.tar.xz mediagoblin-138a18fd6ed18b7415bc3bdcf9c0300c3d6a8c85.zip |
Implement licenses.get_license_by_url
Rather than exploding in the user's face (for example if we custom-configure
licenses in our MG instance, and there are still media with now "unknown"
licenses in the db), simply return a License object as a fallback, where all
attributes are set to the URLÂ we were handed.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
Diffstat (limited to 'mediagoblin/db/mixin.py')
-rw-r--r-- | mediagoblin/db/mixin.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mediagoblin/db/mixin.py b/mediagoblin/db/mixin.py index 7b4bafce..a8436c70 100644 --- a/mediagoblin/db/mixin.py +++ b/mediagoblin/db/mixin.py @@ -139,7 +139,7 @@ class MediaEntryMixin(object): def get_license_data(self): """Return license dict for requested license""" - return licenses.SUPPORTED_LICENSES[self.license or ""] + return licenses.get_license_by_url(self.license or "") def exif_display_iter(self): from mediagoblin.tools.exif import USEFUL_TAGS |