mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
Merge pull request #1159 from gradido/login_fix_creation_validation
Login fix creation validation
This commit is contained in:
commit
78a154ed7a
@ -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");
|
||||
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user