#792 [frontend] api /project/list to skip group projects
Merged 4 years ago by praiskup. Opened 4 years ago by praiskup.

@@ -72,6 +72,7 @@

          query = CoprsLogic.filter_by_group_name(query, group_name)

      else:

          query = CoprsLogic.get_multiple_owned_by_username(ownername)

+         query = CoprsLogic.filter_without_group_projects(query)

  

      # @TODO ordering doesn't work correctly - try order by models.Copr.name DESC

      paginator = Paginator(query, models.Copr, **kwargs)

The fact that user historically created the group project
(copr.user_id == user.id) doesn't necessarily mean that the same
user can still maintain the project (see PR#780).

So unless owner is explicitly specified to @group, the query
shouldn't pollute the output by group projects by default.

Also, we only print the "name", not "full_name" -- so it was
also hard to recognize what project was user-project, and what was
group-project.

The fact that user historically created the group project
(copr.user_id == user.id) doesn't necessarily mean that the same
user can still maintain the project (see PR#780).

That's true, ... this PR is probably a step in the right direction. However, and I am not even sure, that this use-case works properly now, ... IMHO not, but it should. What if I want to ask for a list of my projects (meaning, that they are mine or owned by some group that I belong into)?

Also, we only print the "name", not "full_name" -- so it was
also hard to recognize what project was user-project, and what was
group-project.

Where? :-)
I am quite sure, that the API returns even full_name, so it should only be a matter of printing it. We may revisit that.

What if I want to ask for a list of my projects (meaning, that they are mine or owned by some group that I belong into)?

That is unimplemented semantics, though. I didn't want to invent something new (checking all groups I belong to, and concatenate the results) in this PR.

Where? :-)

In client. Yes, client has the needed data to print full_name, but it doesn't...
Again, I didn't want to make any new (perhaps incompatible) changes in this PR.

That's true. Let's go for this PR as is.
+1

rebased onto 5862b69

4 years ago

Pull-Request has been merged by praiskup

4 years ago