Skip to content

Commit

Permalink
fix: sync content updates too
Browse files Browse the repository at this point in the history
  • Loading branch information
kdmccormick committed Jun 21, 2024
1 parent b44240c commit 03ac145
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions cms/lib/xblock/authoring_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,17 @@ def _sync_with_upstream(self, *, user_id: int, apply_updates: bool) -> None:
print("4==================")
self.upstream_version = upstream_version
for field_name, field in upstream.fields.items():
if field.scope not in [Scope.settings, Scope.content]:
continue
value = getattr(upstream, field_name)
if field.scope == Scope.settings:
value = getattr(upstream, field_name)
self.upstream_settings[field_name] = value
print(field_name)
if apply_updates and field_name not in self.upstream_overidden:
setattr(self, field_name, value)
if field_name in self.upstream_overridden:
continue
if not apply_updates:
continue
print("UPDATE:", field_name)
setattr(self, field_name, value)
print("5==================")
print(self.upstream_settings)

Expand Down

0 comments on commit 03ac145

Please sign in to comment.