Skip to content

Commit

Permalink
Postgresql Database: Escape underscore
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-janssen committed Jan 13, 2025
1 parent 20a33c9 commit 43b3358
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pyiron_base/database/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,18 +329,18 @@ def _job_dict(
{str(element.split()[0]): element.split()[2] for element in cl_split}
)
if job is not None:
dict_clause["job"] = str(job)
dict_clause["job"] = str(job).replace("_", "\_")

if project_path == "./":
project_path = ""
if recursive:
dict_clause["project"] = str(project_path) + "%"
dict_clause["project"] = str(project_path).replace("_", "\_") + "%"
else:
dict_clause["project"] = str(project_path)
dict_clause["project"] = str(project_path).replace("_", "\_")
if sub_job_name is None:
dict_clause["subjob"] = None
elif sub_job_name != "%":
dict_clause["subjob"] = str(sub_job_name)
dict_clause["subjob"] = str(sub_job_name).replace("_", "\_")
if element_lst is not None:
dict_clause["element_lst"] = element_lst

Expand Down

0 comments on commit 43b3358

Please sign in to comment.