Let new_album take multiple associated directories.

This commit is contained in:
voussoir 2020-09-11 15:02:33 -07:00
parent 519bcf32e6
commit 7705848714

View file

@ -79,7 +79,7 @@ class PDBAlbumMixin:
title=None, title=None,
description=None, description=None,
*, *,
associated_directory=None, associated_directories=None,
author=None, author=None,
photos=None, photos=None,
): ):
@ -106,8 +106,10 @@ class PDBAlbumMixin:
album = self.get_cached_instance('album', data) album = self.get_cached_instance('album', data)
if associated_directory is not None: associated_directories = associated_directories or ()
album.add_associated_directory(associated_directory) if isinstance(associated_directories, str):
associated_directories = [associated_directories]
album.add_associated_directories(associated_directories)
if photos is not None: if photos is not None:
photos = [self.get_photo(photo) for photo in photos] photos = [self.get_photo(photo) for photo in photos]