remove empty public lists

This commit is contained in:
j 2019-01-31 22:04:47 +05:30
parent ca35c413fe
commit a495fc398d
2 changed files with 9 additions and 3 deletions

View file

@ -90,11 +90,9 @@ USER_AGENT = 'OpenMediaLibrary/%s' % VERSION
DEBUG_HTTP = server.get('debug_http', False)
DEBUG_API = server.get('debug_api', False)
DB_VERSION = 13
FULLTEXT_SUPPORT = fulltext.platform_supported()
if not FULLTEXT_SUPPORT:
config['itemKeys'] = [k for k in config['itemKeys'] if k['id'] != 'fulltext']
DB_VERSION = 14

View file

@ -617,3 +617,11 @@ def migrate_13():
if revision > -1:
settings.server['revision'] = revision
return 13
def migrate_14():
from user.models import List
with db.session():
l = List.get(':Public')
if l and not len(l.items):
l.remove()
return 14