Revision 552eaedd flowspec/forms.py

b/flowspec/forms.py
130 130
            raise forms.ValidationError('Fill at least a Rule Match Condition')
131 131
        if not user.is_superuser and then[0].action not in settings.UI_USER_THEN_ACTIONS:
132 132
            raise forms.ValidationError('This action "%s" is not permitted' %(then[0].action))
133
        existing_routes = Route.objects.exclude(status='EXPIRED').exclude(status='ERROR').exclude(status='ADMININACTIVE')
133
        existing_routes = Route.objects.all()
134 134
        existing_routes = existing_routes.filter(applier__userprofile__peer=peer)
135 135
        if source:
136 136
            source = IPNetwork(source).compressed
......
259 259
            if same_source_nets:
260 260
                raise forms.ValidationError("Detected same sources")
261 261
            rules.append(rule)
262
        raise forms.ValidationError("%s" %rules)
262
        return rules
263 263

  
264 264
RuleFormSet = modelformset_factory(Route, form=RouteForm, formset=MyRuleFormSet)
265 265

  

Also available in: Unified diff