Skip to content
Snippets Groups Projects
Verified Commit 27e7fc26 authored by Nik | Klampfradler's avatar Nik | Klampfradler
Browse files

Fix issues reported by pylama.

parent 945c7113
No related branches found
No related tags found
No related merge requests found
......@@ -196,11 +196,11 @@ def book_copies_labels(request: HttpRequest, id_: int) -> HttpResponse:
with TemporaryDirectory() as temp_dir:
def draw_label(label, width, height, obj):
title = shapes.String(0, height-10, obj.book.title, fontSize=10)
title = shapes.String(0, height - 10, obj.book.title, fontSize=10)
label.add(title)
copy_desc = shapes.String(
0, height-20, _('Copy number: %d') % obj.copy_num, fontSize=8)
0, height - 20, _('Copy number: %d') % obj.copy_num, fontSize=8)
label.add(copy_desc)
barcode_raw = barcode.createBarcodeImageInMemory(
......@@ -266,12 +266,12 @@ def person_borrow(request: HttpRequest) -> HttpResponse:
if person_borrow_form.is_valid():
person = person_borrow_form.cleaned_data['borrower']
for barcode in person_borrow_form.cleaned_data['barcodes'].splitlines():
for barcode_line in person_borrow_form.cleaned_data['barcodes'].splitlines():
try:
book_copy = BookCopy.objects.get(barcode=barcode)
book_copy = BookCopy.objects.get(barcode=barcode_line)
except BookCopy.DoesNotExist:
messages.error(request, _('Barcode %(barcode)s is invalid.') %
{'barcode': barcode})
{'barcode': barcode_line})
continue
book_copy.borrower = person
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment