build: Updates content_staging based on type checking.

In the serializer, return an empty string if there is no request object.

In content_tagging, just update the type declaration to match the
expectation since it can obviously be a None type.
This commit is contained in:
Feanil Patel
2025-07-23 10:45:47 -04:00
parent 3d773bf655
commit fcf833e62c
2 changed files with 2 additions and 2 deletions

View File

@@ -66,7 +66,7 @@ class UserClipboardSerializer(serializers.Serializer):
except ItemNotFoundError:
return ""
edit_url = xblock_studio_url(block, find_parent=True)
if edit_url:
if edit_url and request:
return request.build_absolute_uri(edit_url)
return ""

View File

@@ -201,7 +201,7 @@ class ObjectTagExportView(APIView):
def write(self, value):
return value
object_id: str = kwargs.get('context_id', None)
object_id: str | None = kwargs.get('context_id', None)
pseudo_buffer = Echo()
if not has_view_object_tags_access(self.request.user, object_id):