Check not development for plan error

This commit is contained in:
Jake Barnby
2025-06-12 12:20:21 -04:00
parent 517870dd45
commit cf830affc9
2 changed files with 1 additions and 2 deletions
+1 -1
View File
@@ -1351,7 +1351,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/string
->inject('queueForEvents')
->inject('plan')
->action(function (string $databaseId, string $collectionId, string $key, ?int $size, ?bool $required, ?string $default, bool $array, bool $encrypt, Response $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents, array $plan) {
if ($encrypt && !empty($plan) && !($plan['databasesAllowEncrypt'] ?? false)) {
if (!App::isDevelopment() && $encrypt && !empty($plan) && !($plan['databasesAllowEncrypt'] ?? false)) {
throw new Exception(Exception::GENERAL_BAD_REQUEST, 'Encrypted string attributes are not available on your plan. Please upgrade to create encrypted string attributes.');
}
if ($encrypt && $size < APP_DATABASE_ENCRYPT_SIZE_MIN) {
@@ -641,7 +641,6 @@ class DatabasesCustomServerTest extends Scope
/**
* @depends testListCollections
* @group cl-ignore
*/
public function testCreateEncryptedAttribute(array $data): void
{