Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
685e0f2cc710
Commit
685e0f2c
authored
Feb 11, 2013
by
Dmitriy Zaporozhets
Browse files
Fix project creation without import
parent
ea1081fd0565
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/models/project.rb
View file @
685e0f2c
...
...
@@ -76,7 +76,9 @@
validates_uniqueness_of
:name
,
scope: :namespace_id
validates_uniqueness_of
:path
,
scope: :namespace_id
validates
:import_url
,
format:
{
with:
URI
::
regexp
(
%w(http https)
),
message:
"should be a valid url"
}
validates
:import_url
,
format:
{
with:
URI
::
regexp
(
%w(http https)
),
message:
"should be a valid url"
},
if: :import?
validate
:check_limit
,
:repo_name
...
...
@@ -147,6 +149,10 @@
id
&&
valid?
end
def
import?
import_url
.
present?
end
def
check_limit
unless
creator
.
can_create_project?
errors
[
:base
]
<<
(
"Your own projects limit is
#{
creator
.
projects_limit
}
! Please contact administrator to increase it"
)
...
...
Write
Preview
Supports
Markdown
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