def create_constant_rules(phase_order=DEFAULT_PHASE_ORDER, card_types=DEFAULT_CARD_TYPES): ''' Creates a set of constant rules. ''' if Rules.objects(_is_constant=True): #@UndefinedVariable raise DominionException( '''Constant rules configuration document already exists , please check your actions again''') else: rules = Rules(phase_order=phase_order, card_types=card_types, _is_constant=True) return rules