Commit db03bfa8 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Apply user project limit only for personal projects. We should not include...

Apply user project limit only for personal projects. We should not include group projects for user limit
parent 0a0cdc6c
...@@ -294,12 +294,12 @@ class User < ActiveRecord::Base ...@@ -294,12 +294,12 @@ class User < ActiveRecord::Base
end end
def projects_limit_left def projects_limit_left
projects_limit - owned_projects.count projects_limit - personal_projects.count
end end
def projects_limit_percent def projects_limit_percent
return 100 if projects_limit.zero? return 100 if projects_limit.zero?
(owned_projects.count.to_f / projects_limit) * 100 (personal_projects.count.to_f / projects_limit) * 100
end end
def recent_push project_id = nil def recent_push project_id = nil
......
...@@ -70,9 +70,9 @@ ...@@ -70,9 +70,9 @@
- unless current_user.projects_limit_left > 100 - unless current_user.projects_limit_left > 100
%fieldset %fieldset
%legend %legend
Owned projects: Personal projects:
%small.pull-right %small.pull-right
%span= current_user.owned_projects.count %span= current_user.personal_projects.count
of of
%span= current_user.projects_limit %span= current_user.projects_limit
.padded .padded
......
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