Clean up E226 errors

This commit is contained in:
Karl Hobley 2015-04-03 18:35:23 +01:00
parent 71441defc4
commit 0143fb9944
2 changed files with 2 additions and 2 deletions

View file

@ -46,7 +46,7 @@ def main_nav_js():
def ellipsistrim(value, max_length):
if len(value) > max_length:
truncd_val = value[:max_length]
if not len(value) == max_length+1 and value[max_length+1] != " ":
if not len(value) == (max_length + 1) and value[max_length + 1] != " ":
truncd_val = truncd_val[:truncd_val.rfind(" ")]
return truncd_val + "..."
return value

View file

@ -111,7 +111,7 @@ def edit(request, image_id, callback=None):
if not image.is_editable_by_user(request.user):
raise PermissionDenied
form = ImageForm(request.POST, request.FILES, instance=image, prefix='image-'+image_id)
form = ImageForm(request.POST, request.FILES, instance=image, prefix='image-' + image_id)
if form.is_valid():
form.save()