Commit b4967b37 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Dont allow to select a project you have no right to assign

parent 11b7b93c
......@@ -9,9 +9,8 @@ class Teams::ProjectsController < Teams::ApplicationController
def new
user_team
@avaliable_projects = Project.scoped
@avaliable_projects = current_user.owned_projects.scoped
@avaliable_projects = @avaliable_projects.without_team(user_team) if user_team.projects.any?
#@projects.reject!(&:empty_repo?)
redirect_to team_projects_path(user_team), notice: "No avalible projects." unless @avaliable_projects.any?
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment