Skip to content

Commit

Permalink
don't make folder if already exists
Browse files Browse the repository at this point in the history
  • Loading branch information
Maziyar Boustani committed Oct 12, 2015
1 parent b6c5687 commit 1ac0692
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,12 @@ def index(self):
else:
print "ERROR: Cannot create Collection. User not registered or logged in."

for collection in girderCollection.list():
if collection['name'] == GIRDER_COLLECTION:
girderFolder.createFolder(collection, 'uploaded_files', description="uploaded files", parentType='collection')
else:
print "WARNING: Uploaded_Files folder already exists."
try:
for collection in girderCollection.list():
if collection['name'] == GIRDER_COLLECTION:
girderFolder.createFolder(collection, 'uploaded_files', description="uploaded files", parentType='collection')
except:
print "WARNING: Uploaded_Files folder already exists."

main_conf = {
'/': {
Expand Down

0 comments on commit 1ac0692

Please sign in to comment.