def fix_view_modes(action):
 if (not action.get('views')):
  generate_views(action)
 if (action.pop('view_type', 'form') != 'form'):
  return action
 if ('view_mode' in action):
  action['view_mode'] = ','.join(((mode if (mode != 'tree') else 'list') for mode in action['view_mode'].split(',')))
 action['views'] = [[id, (mode if (mode != 'tree') else 'list')] for (id, mode) in action['views']]
 return action

def fix_view_modes ( action ) : if ( not action . get ( 'views' ) ) : generate_views ( action ) if ( action . pop ( 'view_type' , 'form' ) != 'form' ) : return action if ( 'view_mode' in action ) : action [ 'view_mode' ] = ',' . join ( ( ( mode if ( mode != 'tree' ) else 'list' ) for mode in action [ 'view_mode' ] . split ( ',' ) ) ) action [ 'views' ] = [ [ id , ( mode if ( mode != 'tree' ) else 'list' ) ] for ( id , mode ) in action [ 'views' ] ] return action
for historical reasons .