Preload metadata add form with metadata type valid for the context document.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
@@ -127,7 +127,9 @@ class DocumentMetadataAddView(MultipleObjectFormActionView):
|
|||||||
if queryset.count() == 1:
|
if queryset.count() == 1:
|
||||||
result.update(
|
result.update(
|
||||||
{
|
{
|
||||||
'queryset': MetadataType.objects.exclude(
|
'queryset': MetadataType.objects.get_for_document_type(
|
||||||
|
document_type=queryset.first().document_type
|
||||||
|
).exclude(
|
||||||
pk__in=MetadataType.objects.get_for_document(
|
pk__in=MetadataType.objects.get_for_document(
|
||||||
document=queryset.first()
|
document=queryset.first()
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user