From 5f019da5629f4d193eb9c5acb81187dccdafae9d Mon Sep 17 00:00:00 2001 From: Mads Jensen Date: Wed, 7 Mar 2018 10:48:59 +0100 Subject: [PATCH] Deleted a redundant initialization in wiki.decorators.get_article. --- src/wiki/decorators.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/wiki/decorators.py b/src/wiki/decorators.py index 531eb23f..05f16b58 100644 --- a/src/wiki/decorators.py +++ b/src/wiki/decorators.py @@ -63,8 +63,6 @@ def get_article(func=None, can_read=True, can_write=False, # noqa path = kwargs.pop('path', None) article_id = kwargs.pop('article_id', None) - urlpath = None - # fetch by urlpath.path if path is not None: try: @@ -99,10 +97,7 @@ def get_article(func=None, can_read=True, can_write=False, # noqa else: # Be robust: Somehow article is gone but urlpath exists... # clean up - return_url = reverse( - 'wiki:get', - kwargs={ - 'path': urlpath.parent.path}) + return_url = reverse('wiki:get', kwargs={'path': urlpath.parent.path}) urlpath.delete() return HttpResponseRedirect(return_url) -- 2.45.2