Check if required fields are filled in.
continuous-integration/drone/push Build is passing Details

This commit is contained in:
tastytea 2020-10-19 16:05:26 +02:00
parent ffbc01a5da
commit 7ac8ddb230
Signed by: tastytea
GPG Key ID: CFC39497F1B26E07
1 changed files with 10 additions and 0 deletions

View File

@ -43,6 +43,16 @@ int main()
try
{
const entry_type entry{cgi::parse_formdata()};
if (entry.instance.empty() || entry.tags.empty()
|| entry.receipts.empty() || entry.description.empty())
{
// Probably spam, since the input fields are marked as required.
cout << "One of the required fields (Instance, Tags, Receipts, "
"Description) was not filled.\r\n"
<< "Please use the back button, complete the form and submit "
"again.\r\n";
return 1;
}
git::update_cached_repo();
git::create_branch();