aboutsummaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--server/views.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/server/views.py b/server/views.py
index 13eb6e4..c569d56 100644
--- a/server/views.py
+++ b/server/views.py
@@ -1049,6 +1049,13 @@ def docedit_wrapper(request, context):
group = Group.objects.filter(name=custom_group)[0]
custom_group_bool = True
+ # we are changing the doc group hence update all existing docs
+ if doc.group != group:
+ existing_docs = Document.objects.filter(document_type=doc)
+ for existing_doc in existing_docs:
+ existing_doc.group = group
+ existing_doc.save()
+
# edit type
doc.custom_group = custom_group_bool
doc.auto_sign = auto_sign