Skip to content
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,11 @@ def _save_xblock(
for metadata_key, value in metadata.items():
field = xblock.fields[metadata_key]

# Prevent setting release date to null
# remove field and inherit from parent instead
if metadata_key == "start" and value == "":

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@viadanna I'm concerned about how generic this is. If other blocks have a "start" field, this behavior will also effect them right? Is that intended?

I think having this kind of logic that is specific to the course_details live in the course_details api makes more sense: https://github.com/openedx/edx-platform/blob/master/cms/djangoapps/contentstore/rest_api/v1/views/course_details.py#L121

But perhaps I'm missing something.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@feanil If this is too generic, we can close the PR. The original intent was to fix an issue here, which was fixed in Teak by catching the AttributeError.

value = None

if value is None:
field.delete_from(xblock)
else:
Expand Down
Loading