'No Album' Album Added

This commit is contained in:
tanshu 2015-07-01 16:41:31 +05:30
parent d4ca3fffa0
commit 1f9548c58f
3 changed files with 7 additions and 3 deletions

View File

@ -32,6 +32,10 @@ def fixtures(engine):
uuid.UUID('8de98592-76d9-c74d-bb3f-d6184d388b5a')) uuid.UUID('8de98592-76d9-c74d-bb3f-d6184d388b5a'))
DBSession.add(user) DBSession.add(user)
no_album = Album('Unclassified', 'Uncategorized images', user, True,
uuid.UUID('1b209cd4-e04e-48ac-a1b0-ec5fdc85b492'), True)
DBSession.add(no_album)
roles = [Role('Owner', uuid.UUID('52e08c0c-048a-784f-be10-6e129ad4b5d4'))] roles = [Role('Owner', uuid.UUID('52e08c0c-048a-784f-be10-6e129ad4b5d4'))]
for role in roles: for role in roles:

View File

@ -113,8 +113,8 @@ class Album(Base):
return DBSession.query(cls).filter(cls.semantic.ilike(semantic)).first() return DBSession.query(cls).filter(cls.semantic.ilike(semantic)).first()
@classmethod @classmethod
def menu_item(cls): def no_album(cls):
return uuid.UUID('dad46805-f577-4e5b-8073-9b788e0173fc') return uuid.UUID('1b209cd4-e04e-48ac-a1b0-ec5fdc85b492')
@classmethod @classmethod
def semi(cls): def semi(cls):

View File

@ -36,7 +36,7 @@ def upload(request):
elif 'album' in request.POST: elif 'album' in request.POST:
album = Album.by_name(request.POST['album']) album = Album.by_name(request.POST['album'])
else: else:
album = None album = Album.by_id(Album.no_album())
return upload_file(input_file, name, last_modified_date, album, uuid.UUID(authenticated_userid(request))) return upload_file(input_file, name, last_modified_date, album, uuid.UUID(authenticated_userid(request)))