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:
@@ -66,7 +66,7 @@ class UserClipboardSerializer(serializers.Serializer):
|
|||||||
except ItemNotFoundError:
|
except ItemNotFoundError:
|
||||||
return ""
|
return ""
|
||||||
edit_url = xblock_studio_url(block, find_parent=True)
|
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 request.build_absolute_uri(edit_url)
|
||||||
return ""
|
return ""
|
||||||
|
|
||||||
|
|||||||
@@ -201,7 +201,7 @@ class ObjectTagExportView(APIView):
|
|||||||
def write(self, value):
|
def write(self, value):
|
||||||
return value
|
return value
|
||||||
|
|
||||||
object_id: str = kwargs.get('context_id', None)
|
object_id: str | None = kwargs.get('context_id', None)
|
||||||
pseudo_buffer = Echo()
|
pseudo_buffer = Echo()
|
||||||
|
|
||||||
if not has_view_object_tags_access(self.request.user, object_id):
|
if not has_view_object_tags_access(self.request.user, object_id):
|
||||||
|
|||||||
Reference in New Issue
Block a user