Merge branch 'TheHollidayInn-api-v3-challenge-shortname-validation' into api-v3

This commit is contained in:
Blade Barringer
2016-05-22 20:58:23 -05:00
6 changed files with 24 additions and 14 deletions

View File

@@ -120,6 +120,8 @@ habitrpg.controller("ChallengesCtrl", ['$rootScope','$scope', 'Shared', 'User',
$scope.save = function(challenge) {
if (!challenge.group) return alert(window.env.t('selectGroup'));
if (!challenge.shortName || challenge.shortName.length < 3) return alert(window.env.t('shortNameTooShort'));
var isNew = !challenge._id;
if(isNew && challenge.prize > $scope.maxPrize) {