Skip to content

Commit

Permalink
Fix flake
Browse files Browse the repository at this point in the history
  • Loading branch information
Henrique Moco committed Nov 23, 2015
1 parent 9ab2299 commit 1027191
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions institutions/institutions.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@
def setup():
Institution.init()


def remove():
es = Elasticsearch(ELASTIC_URI, request_timeout=ELASTIC_TIMEOUT)
es.indices.delete(ELASTIC_INST_INDEX)


class Institution(DocType):
name = String()
established = String()
Expand Down
4 changes: 3 additions & 1 deletion tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,16 +310,18 @@ def institutions(grid_file='institutions/grid_2015_10_09.json', ipeds_file='inst
grid(grid_file)
ipeds(ipeds_file)


@task
def remove_institutions(skip=False):
if not skip:
resp = six.moves.input('You are about to delete the institutions index. Are you sure? (y, n)\n')
if resp not in ('y', 'Y', 'Yes', 'yes'):
print ('Remove institutions stopped.')
print('Remove institutions stopped.')
return
from institutions.institutions import remove
remove()


def grid(grid_file):
from institutions import institutions, grid
institutions.setup()
Expand Down

0 comments on commit 1027191

Please sign in to comment.