From bdc2a3ea27e2980c8c0fbdba2efe6b65291692c2 Mon Sep 17 00:00:00 2001 From: Jan Szejko Date: Mon, 3 Sep 2018 14:33:40 +0200 Subject: [PATCH] smarter mark final form --- apps/catalogue/forms.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/catalogue/forms.py b/apps/catalogue/forms.py index a256dfa1..ea6a4aef 100644 --- a/apps/catalogue/forms.py +++ b/apps/catalogue/forms.py @@ -203,7 +203,7 @@ class MarkFinalForm(forms.Form): def clean_books(self): books_value = self.cleaned_data['books'] - slugs = [line.split('/')[-2] for line in books_value.split('\n') if line.strip()] + slugs = [line.strip().strip('/').split('/')[-1] for line in books_value.split('\n') if line.strip()] books = Book.objects.filter(slug__in=slugs) if len(books) != len(slugs): raise forms.ValidationError( -- 2.20.1