diff options
author | Christopher Allan Webber <cwebber@dustycloud.org> | 2013-02-26 13:38:11 -0600 |
---|---|---|
committer | Christopher Allan Webber <cwebber@dustycloud.org> | 2013-02-26 13:38:11 -0600 |
commit | 7de20e52345949fa9d377f06ab0241d98063d9c9 (patch) | |
tree | 1c73054310000bbbdaed52379555513f928910f3 /mediagoblin/db/mixin.py | |
parent | 397c22d1396cef285e3752d3972979bf53beb988 (diff) | |
download | mediagoblin-7de20e52345949fa9d377f06ab0241d98063d9c9.tar.lz mediagoblin-7de20e52345949fa9d377f06ab0241d98063d9c9.tar.xz mediagoblin-7de20e52345949fa9d377f06ab0241d98063d9c9.zip |
Media URLs with ids in them are now like /u/cwebber/m/id:4112/ rather than /u/cwebber/m/4112/
This avoids some potential name collision issues.
This commit sponsored by Asokan Pichai. Thank you!
Diffstat (limited to 'mediagoblin/db/mixin.py')
-rw-r--r-- | mediagoblin/db/mixin.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/mediagoblin/db/mixin.py b/mediagoblin/db/mixin.py index b69e7d51..6789a970 100644 --- a/mediagoblin/db/mixin.py +++ b/mediagoblin/db/mixin.py @@ -150,8 +150,10 @@ class MediaEntryMixin(object): @property def slug_or_id(self): - return (self.slug or self.id) - + if self.slug: + return self.slug + else: + return u'id:%s' % self.id def url_for_self(self, urlgen, **extra_args): """ |