Skip to content

Commit dc689eb

Browse files
committed
#342 Do not check name for uniqueness for deleted teams
1 parent d9c2ea1 commit dc689eb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

common/models/Team/Validator/Unique.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ protected function validateAttribute($team, $attribute)
2828
$criteria
2929
->addCond('_id', '!=', $team->_id)
3030
->addCond('name', '==', new \MongoRegex('/^' . preg_quote($name) . '$/i'))
31-
->addCond('year', '==', $year);
31+
->addCond('year', '==', $year)
32+
->addCond('isDeleted', '==', false);
3233
$team2 = Team::model()->find($criteria);
3334

3435
// If 2nd team exists then add error

0 commit comments

Comments
 (0)