def _update_module_location(module, new_location):
 if isinstance(module, XModuleDescriptor):
  rekey_fields = []
 else:
  rekey_fields = ((module.get_explicitly_set_fields_by_scope(Scope.content).keys() + module.get_explicitly_set_fields_by_scope(Scope.settings).keys()) + module.get_explicitly_set_fields_by_scope(Scope.children).keys())
 module.location = new_location
 if (len(rekey_fields) > 0):
  module.force_save_fields(rekey_fields)

def _update_module_location ( module , new_location ) : if isinstance ( module , XModuleDescriptor ) : rekey_fields = [ ] else : rekey_fields = ( ( module . get_explicitly_set_fields_by_scope ( Scope . content ) . keys ( ) + module . get_explicitly_set_fields_by_scope ( Scope . settings ) . keys ( ) ) + module . get_explicitly_set_fields_by_scope ( Scope . children ) . keys ( ) ) module . location = new_location if ( len ( rekey_fields ) > 0 ) : module . force_save_fields ( rekey_fields )
update a modules location .