Return to the same source view after uploading a document.

Signed-off-by: Michael Price <loneviking72@gmail.com>
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
Michael Price
2018-03-19 02:02:01 -04:00
committed by Roberto Rosario
parent 8ecd9a31c8
commit a23f26f4f4
2 changed files with 10 additions and 4 deletions

View File

@@ -50,6 +50,7 @@ Next (2018-XX-XX)
- Removed redundant permissions checks. - Removed redundant permissions checks.
- Move the page count display to the top of the image. - 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 '' %} - 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) 2.8 (2018-02-27)
================ ================

View File

@@ -264,8 +264,10 @@ class UploadInteractiveView(UploadBaseView):
return HttpResponseRedirect( return HttpResponseRedirect(
'{}?{}'.format( '{}?{}'.format(
reverse(self.request.resolver_match.view_name), reverse(
self.request.META['QUERY_STRING'] 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'] = _( context['title'] = _(
'Upload a local document from source: %s' 'Upload a local document from source: %s'
) % self.source.label ) % self.source.label
if not isinstance(self.source, StagingFolderSource) and not isinstance(self.source, SaneScanner): if not isinstance(self.source, StagingFolderSource) and not isinstance(self.source, SaneScanner):
context['subtemplates_list'][0]['context'].update( context['subtemplates_list'][0]['context'].update(
{ {
'form_action': '{}?{}'.format( 'form_action': '{}?{}'.format(
reverse(self.request.resolver_match.view_name), reverse(
self.request.META['QUERY_STRING'] self.request.resolver_match.view_name,
kwargs=self.request.resolver_match.kwargs
), self.request.META['QUERY_STRING']
), ),
'form_class': 'dropzone', 'form_class': 'dropzone',
'form_disable_submit': True, 'form_disable_submit': True,