Skip to content

Commit

Permalink
update indexing
Browse files Browse the repository at this point in the history
  • Loading branch information
mrhanlon committed Apr 21, 2016
1 parent 1c53b0b commit 966c3ff
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions designsafe/apps/auth/tasks.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from django.conf import settings
from agavepy.agave import Agave, AgaveException
from dsapi.agave import utils as agave_utils
from designsafe.libs.elasticsearch.api import Object
from dsapi.agave.daos import FileManager
from celery import shared_task
from requests import HTTPError
import logging
Expand All @@ -24,10 +23,8 @@ def check_or_create_agave_home_dir(username):
filePath='/', body=json.dumps(body))

# add dir to index
home_dir = ag.files.list(systemId=settings.AGAVE_STORAGE_SYSTEM, filePath=username)
home_dir_obj = agave_utils.get_folder_obj(agave_client=ag, file_obj=home_dir[0])
o = Object(**home_dir_obj.to_dict())
o.save()
fm = FileManager(agave_client=ag)
fm.index(settings.AGAVE_STORAGE_SYSTEM, username, username)
except (HTTPError, AgaveException):
logger.exception('Failed to create home directory.',
extra={'user': username,
Expand Down

0 comments on commit 966c3ff

Please sign in to comment.