Skip to content
Snippets Groups Projects
Commit c95dc4f2 authored by Jörn Künsemöller's avatar Jörn Künsemöller
Browse files

TMSS-1218: create parsip ref on subtask creation

parent 359e20da
No related branches found
No related tags found
1 merge request!648TMSS-1218: Add parsets to SIPs and refer to the primary observation subtask as...
......@@ -125,6 +125,16 @@ class SIPidentifier(Model):
if model._state.adding:
model.global_identifier = SIPidentifier.objects.create(source="TMSS")
@staticmethod
def assign_new_parset_id_to_model(model):
"""
Create an Unique Identifier for given model class if model is being created.
"""
if model._state.adding:
model.global_parset_identifier = SIPidentifier.objects.create(source="TMSS")
#
# Instance Objects
#
......@@ -336,6 +346,7 @@ class Subtask(BasicCommon, ProjectPropertyMixin, TemplateSchemaMixin):
self.annotate_validate_add_defaults_to_doc_using_template('specifications_doc', 'specifications_template')
SIPidentifier.assign_new_id_to_model(self)
SIPidentifier.assign_new_parset_id_to_model(self)
# check for uniqueness of SAP names:
# todo: this is a very specific check, that depends on the template. On the task level, we have a javascript
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment