From dab1af18b399784c66bd66892c3f032fbd427053 Mon Sep 17 00:00:00 2001 From: Mads Jensen Date: Tue, 13 Mar 2018 23:48:31 +0100 Subject: [PATCH] Undo some auto-pep8 in attachments/models.py --- src/wiki/plugins/attachments/models.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/wiki/plugins/attachments/models.py b/src/wiki/plugins/attachments/models.py index 4ac40883..84c1e833 100644 --- a/src/wiki/plugins/attachments/models.py +++ b/src/wiki/plugins/attachments/models.py @@ -86,8 +86,7 @@ def upload_path(instance, filename): # Has to match original extension filename if instance.id and instance.attachment and instance.attachment.original_filename: - original_extension = instance.attachment.original_filename.split( - ".")[-1] + original_extension = instance.attachment.original_filename.split(".")[-1] if not extension.lower() == original_extension: raise IllegalFileExtension( "File extension has to be '%s', not '%s'." % @@ -173,11 +172,7 @@ def on_revision_delete(instance, *args, **kwargs): for depth in range(0, max_depth): delete_path = "/".join(path[:-depth] if depth > 0 else path) try: - if len( - os.listdir( - os.path.join( - django_settings.MEDIA_ROOT, - delete_path))) == 0: + if len(os.listdir(os.path.join(django_settings.MEDIA_ROOT, delete_path))) == 0: os.rmdir(delete_path) except OSError: # Raised by os.listdir if directory is missing -- 2.45.2