Skip to content

Commit

Permalink
Fixed issue with #678
Browse files Browse the repository at this point in the history
  • Loading branch information
scottx611x committed Sep 16, 2015
1 parent 5bfb909 commit 77d89da
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
8 changes: 5 additions & 3 deletions refinery/core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@

class UserProfile (models.Model):
"""Extends Django user model:
https://docs.djangoproject.com/en/dev/topics/auth/#storing-additional-information-about-users
https://docs.djangoproject.com/en/dev/topics/auth/#storing-additional
-information-about-users
"""
uuid = UUIDField(unique=True, auto=True)
user = models.OneToOneField(User)
Expand Down Expand Up @@ -155,7 +156,8 @@ def create_catch_all_project(sender, user, request, **kwargs):
class BaseResource (models.Model):
"""Abstract base class for core resources such as projects, analyses,
datasets and so on. See
https://docs.djangoproject.com/en/1.3/topics/db/models/#abstract-base-classes
https://docs.djangoproject.com/en/1.3/topics/db/models/#abstract
-base-classes
for details.
"""
uuid = UUIDField(unique=True, auto=True)
Expand Down Expand Up @@ -896,7 +898,7 @@ def get_managed_group(self):
return None

def save(self, *args, **kwargs):
if len(self.name) == 0 or self.name is False:
if len(self.name) == 0:
logger.error("Group name cannot be empty.")
return
else:
Expand Down
9 changes: 7 additions & 2 deletions refinery/ui/src/js/collaboration/controllers/add-group.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,18 @@ function AddGroupCtrl($modalInstance, groupService, groupDataService) {

function isEmptyOrSpaces(str){

return str === undefined || str === "" || str == " " || str === null || str.match(/^\s*$/) !== null || str.length === 0;
if (str.length === 0) {
return true;
}

}


AddGroupCtrl.prototype.createGroup = function (name) {
var that = this;

if (name === undefined){
name = "";
}
this.groupService.create({name: name }).$promise.then(function (data) {

that.groupDataService.update();
Expand Down

0 comments on commit 77d89da

Please sign in to comment.