Skip to content

validators might fail for name and alias unique false #247

@mpgh

Description

@mpgh

The validators get_or_create_event method does not catch all possible combinations of booleans and risks to return the non-iterable None.

Possible fix, add the following at the end of the method

 if not name_unique and not alias_unique:
        tn = TargetName.objects.get(name=name)
        t = Target.objects.get(pk=tn.target_id)
        created = False
        print('Matched Target ' + name + ' by alias to ' + t.name + ', pk=' + str(t.pk))
        return t, 'non_existing_target_existing_alias'

Metadata

Metadata

Labels

bugSomething isn't working

Type

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions