mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Fix an issue where users were unable to create revenue / expense account combinations with the same name. #2987
This commit is contained in:
parent
8c36a371be
commit
534f4de520
@ -375,13 +375,14 @@ class FireflyValidator extends Validator
|
|||||||
*/
|
*/
|
||||||
public function validateUniqueAccountForUser($attribute, $value, $parameters): bool
|
public function validateUniqueAccountForUser($attribute, $value, $parameters): bool
|
||||||
{
|
{
|
||||||
|
|
||||||
// because a user does not have to be logged in (tests and what-not).
|
// because a user does not have to be logged in (tests and what-not).
|
||||||
if (!auth()->check()) {
|
if (!auth()->check()) {
|
||||||
return $this->validateAccountAnonymously();
|
return $this->validateAccountAnonymously();
|
||||||
}
|
}
|
||||||
if (isset($this->data['what'])) {
|
if (isset($this->data['objectType'])) {
|
||||||
|
|
||||||
return $this->validateByAccountTypeString($value, $parameters, $this->data['what']);
|
return $this->validateByAccountTypeString($value, $parameters, $this->data['objectType']);
|
||||||
}
|
}
|
||||||
if (isset($this->data['type'])) {
|
if (isset($this->data['type'])) {
|
||||||
return $this->validateByAccountTypeString($value, $parameters, $this->data['type']);
|
return $this->validateByAccountTypeString($value, $parameters, $this->data['type']);
|
||||||
|
Loading…
Reference in New Issue
Block a user