(self)
return json_data
Returns the json_text as parsed json_data
Returns the json_text as parsed json_data
Returns the json_text as parsed json_data
def json_data(self):
        """
        Returns the json_text as parsed json_data
        """
        try:
            json_data = hjson.loads(self.json_text)
        except Exception as exc:
            logger.error(f"{exc}. json_text={self.json_text}")
            json_data = {}

        # Generates file names
        base = f"{'_'.join(self.name.split())}_{self.project.uid}_{self.pk}"
        template_name = f"{base}.sh"
        image_name = f"{base}.png"

        # Previously set values.
        current_settings = json_data.get("settings") or {}

        # Overwrite any previously set values with current information.
        current_settings["name"] = self.name
        current_settings["template"] = template_name
        current_settings["image"] = image_name
        current_settings["id"] = self.pk
        current_settings["recipe_uid"] = self.uid
        current_settings["uid"] = self.uid
        current_settings["help"] = self.text
        current_settings["url"] = settings.BASE_URL
        current_settings['root_id'] = self.root.id if self.root else ""
        current_settings['root_uid'] = self.root.uid if self.root else ""
        # Put them back into settings.
        json_data["settings"] = current_settings

        return json_data
def json_data ( self ) : try : json_data = hjson . loads ( self . json_text ) except Exception as exc : logger . error ( f"{exc}. json_text={self.json_text}" ) json_data = { } # Generates file names base = f"{'_'.join(self.name.split())}_{self.project.uid}_{self.pk}" template_name = f"{base}.sh" image_name = f"{base}.png" # Previously set values. current_settings = json_data . get ( "settings" ) or { } # Overwrite any previously set values with current information. current_settings [ "name" ] = self . name current_settings [ "template" ] = template_name current_settings [ "image" ] = image_name current_settings [ "id" ] = self . pk current_settings [ "recipe_uid" ] = self . uid current_settings [ "uid" ] = self . uid current_settings [ "help" ] = self . text current_settings [ "url" ] = settings . BASE_URL current_settings [ 'root_id' ] = self . root . id if self . root else "" current_settings [ 'root_uid' ] = self . root . uid if self . root else "" # Put them back into settings. json_data [ "settings" ] = current_settings return json_data