Skip to content

Commit

Permalink
Fixed group not found error not reporting according to issue 118 on G…
Browse files Browse the repository at this point in the history
…itHub.
  • Loading branch information
DSin52 committed Jan 11, 2016
1 parent 69225d6 commit 9bed46a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion graphs/templates/graphs/help_programmers.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ <h3>REST API calls</h3>
<li><a href="#create_group">Create group</a></li>
<li><a href="#remove_group">Remove group</a></li>
<li><a href="#get_group">Get group</a></li>
--><li><a href="#get_user_groups">Get groups a user belongs to</a></li>
<li><a href="#get_user_groups">Get groups a user belongs to</a></li>
<li><a href="#add_user_to_group">Add user to group</a></li>
<li><a href="#remove_user_from_group">Remove user from group</a></li>
<li><a href="#share_graph">Share a graph with a group</a></li>
Expand Down
12 changes: 12 additions & 0 deletions graphs/util/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -3126,6 +3126,12 @@ def share_graph_with_group(owner, graph, groupId, groupOwner):
if graph_exists == None:
return "Graph does not exist"

# Check to see if the group exists
group_exists = get_group(groupOwner, groupId)

if group_exists == None:
return "Group does not exist"

# Create database connection
db_session = data_connection.new_session()

Expand Down Expand Up @@ -3169,6 +3175,12 @@ def unshare_graph_with_group(owner, graph, groupId, groupOwner):
if graph_exists == None:
return "Graph does not exist!"

# Check to see if the group exists
group_exists = get_group(groupOwner, groupId)

if group_exists == None:
return "Group does not exist"

# Create database connection
db_session = data_connection.new_session()

Expand Down

0 comments on commit 9bed46a

Please sign in to comment.