Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
a36195bd
Commit
a36195bd
authored
Aug 13, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Validate project limit only when create project
parent
34c97a31
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
4 deletions
+7
-4
app/contexts/projects/create_context.rb
app/contexts/projects/create_context.rb
+6
-3
app/models/project.rb
app/models/project.rb
+1
-1
No files found.
app/contexts/projects/create_context.rb
View file @
a36195bd
...
@@ -46,11 +46,14 @@ module Projects
...
@@ -46,11 +46,14 @@ module Projects
@project
.
creator
=
current_user
@project
.
creator
=
current_user
if
@project
.
save
if
@project
.
save
@project
.
discover_default_branch
unless
@project
.
group
unless
@project
.
group
@project
.
users_projects
.
create
(
project_access:
UsersProject
::
MASTER
,
user:
current_user
)
@project
.
users_projects
.
create
(
project_access:
UsersProject
::
MASTER
,
user:
current_user
)
end
end
@project
.
discover_default_branch
end
end
@project
@project
...
...
app/models/project.rb
View file @
a36195bd
...
@@ -89,7 +89,7 @@ class Project < ActiveRecord::Base
...
@@ -89,7 +89,7 @@ class Project < ActiveRecord::Base
format:
{
with:
URI
::
regexp
(
%w(git http https)
),
message:
"should be a valid url"
},
format:
{
with:
URI
::
regexp
(
%w(git http https)
),
message:
"should be a valid url"
},
if: :import?
if: :import?
validate
:check_limit
validate
:check_limit
,
on: :create
# Scopes
# Scopes
scope
:without_user
,
->
(
user
)
{
where
(
"projects.id NOT IN (:ids)"
,
ids:
user
.
authorized_projects
.
map
(
&
:id
)
)
}
scope
:without_user
,
->
(
user
)
{
where
(
"projects.id NOT IN (:ids)"
,
ids:
user
.
authorized_projects
.
map
(
&
:id
)
)
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment