File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -190,11 +190,18 @@ def get_context_data(self, **kwargs):
190190 def post (self , request , * args , ** kwargs ):
191191 # load data model
192192 if "load" in self .request .POST :
193+ context = super (Create , self ).get_context_data (** kwargs )
193194 if self .request .POST .get ("data_model" ) == ".." :
194195 entity_json = {}
195196 else :
196- entity_json = parse_entity (self .request .POST .get ("data_model" ))
197- context = super (Create , self ).get_context_data (** kwargs )
197+ try :
198+ entity_json = parse_entity (self .request .POST .get ("data_model" ))
199+ # except NotImplementedError as e:
200+ except KeyError as e :
201+ messages .error (
202+ self .request , f"Error parsing data model: missing key { e } "
203+ )
204+ entity_json = {}
198205 basic_info = EntityForm (
199206 self .project ,
200207 initial = {"id" : entity_json .get ("id" ), "type" : entity_json .get ("type" )},
You can’t perform that action at this time.
0 commit comments