Commit 73711818 authored by Thom Wiggers's avatar Thom Wiggers 📐
Browse files

Merge branch '217-photo-cover' into 'master'

Constrain album cover selection to photos from album

Closes #217

See merge request !223
parents 6b2bbdc9 85b23793
......@@ -10,6 +10,15 @@ from .models import Album, Photo
class AlbumForm(forms.ModelForm):
# Excuse my french
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
if 'instance' in kwargs:
self.fields['_cover'].queryset = Photo.objects.filter(
album_archive = forms.FileField(
help_text="Uploading a zip file adds all contained images as photos.",
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment