aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorElrond <elrond+mediagoblin.org@samba-tng.org>2013-01-22 22:28:19 +0100
committerElrond <elrond+mediagoblin.org@samba-tng.org>2013-01-22 23:10:30 +0100
commit0c871f81220b3d5c1700a0e4141eb7e52efc04e0 (patch)
tree32a5ccefa0f51a80e032f52dbae460f3ab4ac05b
parent066d49b2c1c8319a5b7805b4a68a8ee2b1c59ad1 (diff)
downloadmediagoblin-0c871f81220b3d5c1700a0e4141eb7e52efc04e0.tar.lz
mediagoblin-0c871f81220b3d5c1700a0e4141eb7e52efc04e0.tar.xz
mediagoblin-0c871f81220b3d5c1700a0e4141eb7e52efc04e0.zip
Use inspect_table; default user license==None.
Use inspect_table in the new migration. Makes code more readable, really. And make the default for the preferred license be None. This is a userspace thing, so we can even change the migration here. Changing the migration means, that people running the migration before this commit get a "" in User.license_preference, while people running the migration now get a None. Both values are okay. None has been designated as "Use the site's default". We're not actually having a site default right now. Which means no license is selected in the dropdown. While "" means "All rights reserved" being chosen by the user. Side note: Having no license being selected in the submit dropdown is as "worse" as before and does not really hurt much. MediaEntry.license==None means "All rights reserved" as does "" also do.
-rw-r--r--mediagoblin/db/migrations.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/mediagoblin/db/migrations.py b/mediagoblin/db/migrations.py
index 3f43c789..b25d577d 100644
--- a/mediagoblin/db/migrations.py
+++ b/mediagoblin/db/migrations.py
@@ -190,9 +190,8 @@ def fix_CollectionItem_v0_constraint(db_conn):
def add_license_preference(db):
metadata = MetaData(bind=db.bind)
- user_table = Table('core__users', metadata, autoload=True,
- autoload_with=db.bind)
+ user_table = inspect_table(metadata, 'core__users')
- col = Column('license_preference', Unicode, default=u'')
+ col = Column('license_preference', Unicode)
col.create(user_table)
db.commit()