Merge pull request #1159 from gradido/login_fix_creation_validation

Login fix creation validation
This commit is contained in:
einhornimmond 2021-12-07 14:13:01 +01:00 committed by GitHub
commit 78a154ed7a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -491,7 +491,7 @@ namespace model {
break;
case TRANSACTION_VALID_INVALID_TARGET_DATE:
error_name = t->gettext_str("Creation Error");
error_description = t->gettext_str("Invalid target date! No future and only 3 month in the past.");
error_description = t->gettext_str("Invalid target date! No future and only 2 month in the past.");
break;
case TRANSACTION_VALID_CREATION_OUT_OF_BORDER:
error_name = t->gettext_str("Creation Error");

View File

@ -74,8 +74,8 @@ namespace model {
auto now = Poco::DateTime();
if (target_date.year() == now.year())
{
if (target_date.month() + 3 < now.month()) {
addError(new Error(function_name, "year is the same, target date month is more than 3 month in past"));
if (target_date.month() + 2 < now.month()) {
addError(new Error(function_name, "year is the same, target date month is more than 2 month in past"));
return TRANSACTION_VALID_INVALID_TARGET_DATE;
}
if (target_date.month() > now.month()) {
@ -96,8 +96,8 @@ namespace model {
else
{
// target_date.year +1 == now.year
if (target_date.month() + 3 < now.month() + 12) {
addError(new Error(function_name, "target date is more than 3 month in past"));
if (target_date.month() + 2 < now.month() + 12) {
addError(new Error(function_name, "target date is more than 2 month in past"));
return TRANSACTION_VALID_INVALID_TARGET_DATE;
}
}