Skip to content

Commit

Permalink
fix: added better selection logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Palanikannan1437 committed Dec 19, 2024
1 parent bc6b8b2 commit 8b77def
Show file tree
Hide file tree
Showing 5 changed files with 1,388 additions and 64 deletions.
14 changes: 6 additions & 8 deletions apiserver/plane/app/views/page/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ def stream_data():
yield b""

response = StreamingHttpResponse(
page.description_binary, content_type="application/octet-stream"
stream_data(), content_type="application/octet-stream"
)
response["Content-Disposition"] = 'attachment; filename="page_description.bin"'
return response
Expand Down Expand Up @@ -530,23 +530,21 @@ def partial_update(self, request, slug, project_id, pk):

print("before base 64")
# Get the base64 data from the request
base64_data = request.body
print("after base 64", base64_data)
base64_data = request.data.get("description_binary")

# If base64 data is provided
if base64_data:
# Decode the base64 data to bytes
# new_binary_data = base64.b64decode(base64_data)
new_binary_data = base64.b64decode(base64_data)
# capture the page transaction
if request.data.get("description_html"):
page_transaction.delay(
new_value=request.data, old_value=existing_instance, page_id=pk
)
# Store the updated binary data
page.description_binary = base64_data
# page.description_html = request.data.get("description_html")
# page.description = request.data.get("description")
print("before save")
page.description_binary = new_binary_data
page.description_html = request.data.get("description_html")
page.description = request.data.get("description")
page.save()
# Return a success response
page_version.delay(
Expand Down
Loading

0 comments on commit 8b77def

Please sign in to comment.