Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/api/plane/license/api/views/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def patch(self, request):

bulk_configurations = []
for configuration in configurations:
value = request.data.get(configuration.key, configuration.value)
value = str(request.data.get(configuration.key, configuration.value)).strip()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Handle null explicitly before stringifying.

str(...).strip() turns a JSON null clear request into the literal "None". Since get_configuration_value() reads persisted values back verbatim, that string will propagate into runtime config instead of behaving like an empty/unset value.

Suggested fix
-            value = str(request.data.get(configuration.key, configuration.value)).strip()
+            raw_value = request.data.get(configuration.key, configuration.value)
+            value = "" if raw_value is None else str(raw_value).strip()
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
value = str(request.data.get(configuration.key, configuration.value)).strip()
raw_value = request.data.get(configuration.key, configuration.value)
value = "" if raw_value is None else str(raw_value).strip()
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/api/plane/license/api/views/configuration.py` at line 48, When building
the new config value, don't call str(...) on a JSON null; instead read the raw =
request.data.get(configuration.key, configuration.value) and if raw is None set
value to an empty string (or other empty/unset sentinel) before calling
.strip(); this prevents JSON null from becoming the literal "None" in persisted
config and aligns with get_configuration_value() semantics. Ensure you update
the assignment around request.data.get(configuration.key, configuration.value)
(referenced by configuration.key and configuration.value) to handle raw is None
explicitly.

if configuration.is_encrypted:
configuration.value = encrypt_data(value)
else:
Expand Down