diff --git a/HISTORY.rst b/HISTORY.rst index 28df79631b..8c84096700 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -50,6 +50,7 @@ Next (2018-XX-XX) - Removed redundant permissions checks. - Move the page count display to the top of the image. - Unify the way to gather the project's metadata. Use mayan.__XX__ and a new common tag named {% project_information '' %} +- Return to the same source view after uploading a document. 2.8 (2018-02-27) ================ diff --git a/mayan/apps/sources/views.py b/mayan/apps/sources/views.py index 477a38f61c..ea47b18a37 100644 --- a/mayan/apps/sources/views.py +++ b/mayan/apps/sources/views.py @@ -264,8 +264,10 @@ class UploadInteractiveView(UploadBaseView): return HttpResponseRedirect( '{}?{}'.format( - reverse(self.request.resolver_match.view_name), - self.request.META['QUERY_STRING'] + reverse( + self.request.resolver_match.view_name, + kwargs=self.request.resolver_match.kwargs + ), self.request.META['QUERY_STRING'] ), ) @@ -308,12 +310,15 @@ class UploadInteractiveView(UploadBaseView): context['title'] = _( 'Upload a local document from source: %s' ) % self.source.label + if not isinstance(self.source, StagingFolderSource) and not isinstance(self.source, SaneScanner): context['subtemplates_list'][0]['context'].update( { 'form_action': '{}?{}'.format( - reverse(self.request.resolver_match.view_name), - self.request.META['QUERY_STRING'] + reverse( + self.request.resolver_match.view_name, + kwargs=self.request.resolver_match.kwargs + ), self.request.META['QUERY_STRING'] ), 'form_class': 'dropzone', 'form_disable_submit': True,