BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
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
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
4 deletions
+7
-4
create_context.rb
app/contexts/projects/create_context.rb
+6
-3
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
@project
.
creator
=
current_user
if
@project
.
save
@project
.
discover_default_branch
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
@project
.
discover_default_branch
end
@project
...
...
app/models/project.rb
View file @
a36195bd
...
...
@@ -89,7 +89,7 @@ class Project < ActiveRecord::Base
format:
{
with:
URI
::
regexp
(
%w(git http https)
),
message:
"should be a valid url"
},
if: :import?
validate
:check_limit
validate
:check_limit
,
on: :create
# Scopes
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