def _update_with_callback(xblock, user, old_metadata=None, old_content=None):
 if callable(getattr(xblock, 'editor_saved', None)):
  if (old_metadata is None):
   old_metadata = own_metadata(xblock)
  if (old_content is None):
   old_content = xblock.get_explicitly_set_fields_by_scope(Scope.content)
  xblock.xmodule_runtime = StudioEditModuleRuntime(user)
  xblock.editor_saved(user, old_metadata, old_content)
 return modulestore().update_item(xblock, user.id)

def _update_with_callback ( xblock , user , old_metadata = None , old_content = None ) : if callable ( getattr ( xblock , 'editor_saved' , None ) ) : if ( old_metadata is None ) : old_metadata = own_metadata ( xblock ) if ( old_content is None ) : old_content = xblock . get_explicitly_set_fields_by_scope ( Scope . content ) xblock . xmodule_runtime = StudioEditModuleRuntime ( user ) xblock . editor_saved ( user , old_metadata , old_content ) return modulestore ( ) . update_item ( xblock , user . id )
updates the xblock in the modulestore .