fix #2492
Merge pull request #2652 from jouve/fix_#2492

fix #2492
Merge branch '4-0-stable' of git://github.com/gitlabhq/gitlabhq into 4-0-stable