Changing a subgroup path always results in an invalid parent group

Summary

Changing a subgroup path always results in an invalid parent group.

Steps to reproduce

  • Create group 'foo'
  • Create subgroup 'bar' under 'foo'
  • Rename subgroup 'bar' to 'baz'
  • Group.find_by_name('foo').valid? => false due to ensure_permanent_paths validation due to conflicting_redirect_exists? returning true because RedirectRoute.permanent.matching_path_and_descendants('foo') returns the descendant subgroup's permanent redirect

What is the current bug behavior?

Parent group is invalid.

What is the expected correct behavior?

Parent group remains valid.

Possible fixes

Not sure yet.

Assignee Loading
Time tracking Loading