From edf5adc5410e69698431706283648450bbcef12c Mon Sep 17 00:00:00 2001 From: Martin Mahner Date: Sun, 29 Apr 2018 11:31:18 +0200 Subject: [PATCH] Further code quality --- dpaste/views.py | 10 +++++----- setup.py | 4 +--- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/dpaste/views.py b/dpaste/views.py index 5c4bd90..12d32b2 100644 --- a/dpaste/views.py +++ b/dpaste/views.py @@ -58,7 +58,7 @@ class SnippetDetailView(SnippetView, DetailView): slug_url_kwarg = 'snippet_id' slug_field = 'secret_id' - def post(self, *args, **kwargs): + def post(self, request, *args, **kwargs): """ Delete a snippet. This is allowed by anybody as long as he knows the snippet id. I got too many manual requests to do this, mostly for legal @@ -73,9 +73,9 @@ class SnippetDetailView(SnippetView, DetailView): url = '{0}#'.format(reverse('snippet_new')) return HttpResponseRedirect(url) - return super(SnippetDetailView, self).post(*args, **kwargs) + return super(SnippetDetailView, self).post(request, *args, **kwargs) - def get(self, *args, **kwargs): + def get(self, request, *args, **kwargs): snippet = self.get_object() # One-Time snippet get deleted if the view count matches our limit @@ -88,7 +88,7 @@ class SnippetDetailView(SnippetView, DetailView): snippet.view_count += 1 snippet.save() - return super(SnippetDetailView, self).get(*args, **kwargs) + return super(SnippetDetailView, self).get(request, *args, **kwargs) def get_initial(self): snippet = self.get_object() @@ -157,7 +157,7 @@ class SnippetHistory(TemplateView): snippet_id_list = self.request.session.get('snippet_list', []) return Snippet.objects.filter(pk__in=snippet_id_list) - def post(self, *args, **kwargs): + def post(self, request, *args, **kwargs): """ Delete all user snippets at once. """ diff --git a/setup.py b/setup.py index d4bb859..e63e7ec 100644 --- a/setup.py +++ b/setup.py @@ -1,8 +1,6 @@ #!/usr/bin/env python -import sys from setuptools import find_packages, setup -from setuptools.command.test import test as TestCommand long_description = u'\n\n'.join(( open('README.rst').read(), @@ -52,7 +50,7 @@ setup( 'coverage', ], extras_require={ - # Packages required for a standalone setup + # Packages required for a standalone setup # (not integrated into an existing setup and settings) 'standalone': { 'django-csp>=3.3',