From 266b42b3dc7697801f726875e1a734b9e4ba7dc9 Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Wed, 23 Jan 2013 15:15:22 -0600 Subject: [PATCH] Switching uuid4()[1:4] -> uuid4().hex[:4] .hex is what we need to access to get at the ascii (hex) version anyway. Also, not sure why the previous version grabbed starting at the index of 1... just grab the first characters instead. --- mediagoblin/db/mixin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mediagoblin/db/mixin.py b/mediagoblin/db/mixin.py index 0e000324..c4c508a4 100644 --- a/mediagoblin/db/mixin.py +++ b/mediagoblin/db/mixin.py @@ -111,7 +111,7 @@ class MediaEntryMixin(object): # let's whack junk on there till it's unique. self.slug += '-' while check_media_slug_used(self.uploader, self.slug, self.id): - self.slug += uuid4()[1:4] + self.slug += uuid4().hex[:4] @property def description_html(self): -- 2.25.1