fix ssh key migration broken with the new team check
This commit is contained in:
@@ -218,9 +218,14 @@ class PrivateKey extends BaseModel
|
|||||||
|
|
||||||
private static function fingerprintExists($fingerprint, $excludeId = null)
|
private static function fingerprintExists($fingerprint, $excludeId = null)
|
||||||
{
|
{
|
||||||
return self::query()
|
$query = self::query()
|
||||||
->where('fingerprint', $fingerprint)
|
->where('fingerprint', $fingerprint);
|
||||||
->where('team_id', currentTeam()->id)
|
|
||||||
|
if (currentTeam()) {
|
||||||
|
$query->where('team_id', currentTeam()->id);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $query
|
||||||
->when($excludeId, fn ($query) => $query->where('id', '!=', $excludeId))
|
->when($excludeId, fn ($query) => $query->where('id', '!=', $excludeId))
|
||||||
->exists();
|
->exists();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user