Refactor checkouts app
Change "checkin" usage to "check_in".
Update URL parameters to the "_id" form.
Add support to checkout and check in multiple documents.
Optimize queries that used an ID list of documents for
filtering using values_list('pk', flat=True). These
queries now use .values('pk') as a subquery.
Add pre save hooks to block new document version uploads.
Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
This commit is contained in:
13
mayan/apps/checkouts/hooks.py
Normal file
13
mayan/apps/checkouts/hooks.py
Normal file
@@ -0,0 +1,13 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.apps import apps
|
||||
|
||||
|
||||
def hook_is_new_version_allowed(document_version):
|
||||
NewVersionBlock = apps.get_model(
|
||||
app_label='checkouts', model_name='NewVersionBlock'
|
||||
)
|
||||
|
||||
NewVersionBlock.objects.new_versions_allowed(
|
||||
document_version=document_version.document
|
||||
)
|
||||
Reference in New Issue
Block a user