Skip to content

Commit

Permalink
Bug in hierarchy API because there is no 3digit industry level anymore
Browse files Browse the repository at this point in the history
  • Loading branch information
makmanalp committed Aug 10, 2015
1 parent 4cf5e69 commit 06b0737
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions colombia/metadata/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,10 @@ def hierarchy(entity_name):
return jsonify(data=dict(q))
elif entity_name == "industries":
if from_level == "4digit" and to_level == "section":
i, i2, i3, i4 = Industry, aliased(Industry), aliased(Industry), aliased(Industry)
q = db.session.query(i.id, i4.id)\
i, i2, i3 = Industry, aliased(Industry), aliased(Industry)
q = db.session.query(i.id, i3.id)\
.join(i2, i2.id == i.parent_id)\
.join(i3, i3.id == i2.parent_id)\
.join(i4, i4.id == i3.parent_id)\
.all()
return jsonify(data=dict(q))

Expand Down

0 comments on commit 06b0737

Please sign in to comment.