Filter environments for user with given project id
Previously, calling `Environment.for_user(user, project)` would return environments a user has access to across all projects. Now, we will only return the relevant environements. This was the cause of a visual bug where extra environments were shown in the project list.
This commit is contained in:
@@ -44,7 +44,7 @@ class Environments(object):
|
||||
.join(EnvironmentRole)
|
||||
.join(Project)
|
||||
.filter(EnvironmentRole.user_id == user.id)
|
||||
.filter(Project.id == Environment.project_id)
|
||||
.filter(Environment.project_id == project.id)
|
||||
.all()
|
||||
)
|
||||
|
||||
|
Reference in New Issue
Block a user