Skip to content

Commit

Permalink
Scottx611x/fix add users to public group timeout (#2996)
Browse files Browse the repository at this point in the history
* Only add a User to the Public Group if they aren't already a member

* Only add user to neo4j upon initial User creation

* Revert "Only add a User to the Public Group if they aren't already a member"

This reverts commit 12f53c6.

* Constrain User addition and annotatio set updating neo4j to active users only;
We still need to run this code for all active users during provisioning because the Neo4J database is recreated each time

* Reverse logic to check if a User is active and add logger
  • Loading branch information
scottx611x committed Sep 11, 2018
1 parent 3b45172 commit 307bc41
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions refinery/core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1978,6 +1978,10 @@ def save(self, *arg, **kwargs):
def _add_user_to_neo4j(sender, **kwargs):
user = kwargs['instance']

if not user.is_active:
logger.debug("User: %s has not been activated. Not adding them to "
"Neo4J.", user.username)
return
add_or_update_user_to_neo4j(user.id, user.username)
add_read_access_in_neo4j(
map(
Expand Down

0 comments on commit 307bc41

Please sign in to comment.