#719 [frontend] don't unselect inactive chroots in project edit; fix #712
Closed 4 years ago by praiskup. Opened 4 years ago by frostyx.
copr/ frostyx/copr dont-unselect-inactive-chroots  into  master

@@ -713,10 +713,13 @@ 

          # delete no more present

          to_remove = []

          for mock_chroot in current_chroots:

-             if mock_chroot not in new_chroots:

-                 # can't delete here, it would change current_chroots and break

-                 # iteration

-                 to_remove.append(mock_chroot)

+             if mock_chroot in new_chroots:

+                 continue

+             if not mock_chroot.is_active:

+                 continue

+             # can't delete here, it would change current_chroots and break

+             # iteration

+             to_remove.append(mock_chroot)

  

          for mc in to_remove:

              copr.mock_chroots.remove(mc)

When editting project settings, the chroots are processed in the
following matter. First, we figure out what chroots are currently
enabled (this list would contain even inactive chroots), then we
figure out what chroots has been selected in the submitted form.
And finally, we add selected chroots that aren't currently enabled
and ... remove currently enabled chroots, that are not in the
submitted form (the form doesn't contain inactive chroots, so
obviously, they disappear and cause #712).

3322f2a

Test would be awesome though.

Pull-Request has been closed by praiskup

4 years ago