Skip to content
This repository has been archived by the owner on Aug 5, 2024. It is now read-only.

Commit

Permalink
fix: Escape strings to remove embedded single quotes
Browse files Browse the repository at this point in the history
  • Loading branch information
rsavoye committed Dec 20, 2023
1 parent 30d521f commit 061b361
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions tm_admin/tmdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,11 @@ def writeAllData(self,
continue
values += "ARRAY["
for item in val:
esc = item.replace("'", "")
values += f"'{esc}', "
if type(item) == str:
esc = item.replace("'", "")
values += f"'{esc}', "
elif type(item) == int:
values += f"{item}, "
values = values[:-2]
values += "], "
continue
Expand All @@ -241,7 +244,10 @@ def writeAllData(self,
values += f"{val}, "
else:
if val is None:
values += f"NULL, "
if self.config[key]['required']:
values += f"'', "
else:
values += f"NULL, "
else:
esc = val.replace("'", "")
values += f"'{esc}', "
Expand Down

0 comments on commit 061b361

Please sign in to comment.