version++ and fix private key saving

This commit is contained in:
Andras Bacsai
2024-11-15 21:22:11 +01:00
parent 3565996224
commit 0eab7f78ff
4 changed files with 8 additions and 9 deletions

View File

@@ -219,15 +219,14 @@ class PrivateKey extends BaseModel
private static function fingerprintExists($fingerprint, $excludeId = null)
{
$query = self::query()
->where('fingerprint', $fingerprint);
->where('fingerprint', $fingerprint)
->where('id', '!=', $excludeId);
if (currentTeam()) {
$query->where('team_id', currentTeam()->id);
}
return $query
->when($excludeId, fn ($query) => $query->where('id', '!=', $excludeId))
->exists();
return $query->exists();
}
public static function cleanupUnusedKeys()