minor fix to avoid the creation of '' templates since crow is incapable of routing those to /<string> while trying to route them to / leading to a 404

obviously it's also possible to just give a general you have to name your template directive but as it stands i don't really see a need for it
This commit is contained in:
Tina_Azure
2023-05-15 19:30:48 +02:00
parent 383db248b7
commit bbf526f99f
2 changed files with 3 additions and 2 deletions

View File

@ -39,7 +39,7 @@ sudo -u postgres psql -c "CREATE TABLE freelancers(
sudo -u postgres psql -c "CREATE TABLE templates( sudo -u postgres psql -c "CREATE TABLE templates(
id INT PRIMARY KEY GENERATED ALWAYS AS IDENTITY, id INT PRIMARY KEY GENERATED ALWAYS AS IDENTITY,
freelancerID int, freelancerID int,
name text, name text NOT NULL,
content text, content text,
contactData text, contactData text,
contactInformation text, contactInformation text,

View File

@ -699,7 +699,8 @@ int main(int argc, char *argv[]) {
if (splitItem.at(0) == "templatepriceondeliver") if (splitItem.at(0) == "templatepriceondeliver")
priceondeliver = splitItem.at(1); priceondeliver = splitItem.at(1);
} }
if (name.empty())
name = "unnamed";
if (!Utilities::checkIfStrIsNumber(priceupfront)) if (!Utilities::checkIfStrIsNumber(priceupfront))
priceupfront = "0"; priceupfront = "0";
if (!Utilities::checkIfStrIsNumber(priceondeliver)) if (!Utilities::checkIfStrIsNumber(priceondeliver))