aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrea Lepori <al@0hm.ch>2024-01-23 17:02:54 +0100
committerAndrea Lepori <al@0hm.ch>2024-01-23 17:02:54 +0100
commit372908c17e39c79a4447c021f662c301b15785ea (patch)
tree5133d4654845c28335efc296e35f9ebe322cf658
parentdoc list table download options (diff)
downloadscout-subs-372908c17e39c79a4447c021f662c301b15785ea.tar.gz
scout-subs-372908c17e39c79a4447c021f662c301b15785ea.zip
update group of docs when type changes
-rw-r--r--server/views.py7
-rw-r--r--version.txt2
2 files changed, 8 insertions, 1 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
diff --git a/version.txt b/version.txt
index d9d6a47..154f90c 100644
--- a/version.txt
+++ b/version.txt
@@ -1,2 +1,2 @@
version=0.7
-rev=13
+rev=14