Make uuid look like a uuid.
authorElrond <elrond+mediagoblin.org@samba-tng.org>
Sat, 27 Apr 2013 15:01:09 +0000 (17:01 +0200)
committerElrond <elrond+mediagoblin.org@samba-tng.org>
Sat, 27 Apr 2013 15:02:37 +0000 (17:02 +0200)
If we really have to create a visible uuid (for a slug in
this case), don't try to hide the fact that it is a uuid.
So format it like a uuid.

mediagoblin/db/migrations.py

index 9d1218feb783fb5ac23f1639a2740bb7908ae307..2c55339608610c90726e56d1ffa26741a23e158d 100644 (file)
@@ -273,7 +273,7 @@ def unique_collections_slug(db):
                 existing_slugs[row.creator].append(row.slug)
 
     for row_id in slugs_to_change:
-        new_slug = uuid.uuid4().hex
+        new_slug = unicode(uuid.uuid4())
         db.execute(collection_table.update().
                    where(collection_table.c.id == row_id).
                    values(slug=new_slug))