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.
This commit is contained in:
parent
066d49b2c1
commit
0c871f8122
@ -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()
|
||||
|
Loading…
x
Reference in New Issue
Block a user