Display error when attempting to recalculate the page count of an empty
document (document stub that has no document version). Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
@@ -21,6 +21,8 @@
|
||||
- Update dropzone.js' timeout from 30 seconds to 120 to allow upload
|
||||
of large files on slow connections.
|
||||
- Increase gunicorn's timeout from 30 seconds to 120.
|
||||
- Display error when attempting to recalculate the page count of an empty
|
||||
document (document stub that has no document version).
|
||||
|
||||
3.0.1 (2018-07-08)
|
||||
=================
|
||||
|
||||
@@ -596,9 +596,21 @@ class DocumentUpdatePageCountView(MultipleObjectConfirmActionView):
|
||||
return result
|
||||
|
||||
def object_action(self, form, instance):
|
||||
task_update_page_count.apply_async(
|
||||
kwargs={'version_id': instance.latest_version.pk}
|
||||
)
|
||||
latest_version = instance.latest_version
|
||||
if latest_version:
|
||||
task_update_page_count.apply_async(
|
||||
kwargs={'version_id': latest_version.pk}
|
||||
)
|
||||
else:
|
||||
messages.error(
|
||||
self.request, _(
|
||||
'Document "%(document)s" is empty. Upload at least one '
|
||||
'document version before attempting to detect the '
|
||||
'page count.'
|
||||
) % {
|
||||
'document': instance,
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
class DocumentTransformationsClearView(MultipleObjectConfirmActionView):
|
||||
|
||||
Reference in New Issue
Block a user