def update_featured_activity_references(featured_activity_references):
 for activity_reference in featured_activity_references:
  activity_reference.validate()
 activity_hashes = [reference.get_hash() for reference in featured_activity_references]
 if (len(activity_hashes) != len(set(activity_hashes))):
  raise Exception('The activity reference list should not have duplicates.')
 featured_model_instance = activity_models.ActivityReferencesModel.get_or_create(activity_models.ACTIVITY_REFERENCE_LIST_FEATURED)
 featured_model_instance.activity_references = [reference.to_dict() for reference in featured_activity_references]
 featured_model_instance.put()

def update_featured_activity_references ( featured_activity_references ) : for activity_reference in featured_activity_references : activity_reference . validate ( ) activity_hashes = [ reference . get_hash ( ) for reference in featured_activity_references ] if ( len ( activity_hashes ) != len ( set ( activity_hashes ) ) ) : raise Exception ( 'The activity reference list should not have duplicates.' ) featured_model_instance = activity_models . ActivityReferencesModel . get_or_create ( activity_models . ACTIVITY_REFERENCE_LIST_FEATURED ) featured_model_instance . activity_references = [ reference . to_dict ( ) for reference in featured_activity_references ] featured_model_instance . put ( )
updates the current list of featured activity references .