Skip to content

Commit d4b28c7

Browse files
committed
warnings
1 parent 4dc638b commit d4b28c7

2 files changed

Lines changed: 8 additions & 5 deletions

File tree

alembic_migration/versions/24f8da659c78_add_ratings_to_outings.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,8 @@ def upgrade():
201201
# using the best route rating for each activity associated with the outing
202202
connection = op.get_bind()
203203
raw_file = join(dirname(__file__), '24f8da659c78_outings.sql')
204-
f = codecs.open(raw_file, encoding='utf-8')
205-
content = f.read()
204+
with codecs.open(raw_file, encoding='utf-8') as f:
205+
content = f.read()
206206
connection.execute(text(content))
207207

208208
# we loop over every existing outing

c2corg_api/views/association.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,12 @@ def collection_delete(self):
140140
return {}
141141

142142
def _load(self, association_in):
143-
return DBSession.query(Association). \
144-
get((association_in.parent_document_id,
145-
association_in.child_document_id))
143+
return DBSession.query(Association).filter(
144+
Association.parent_document_id ==
145+
association_in.parent_document_id,
146+
Association.child_document_id ==
147+
association_in.child_document_id
148+
).first()
146149

147150

148151
def _check_required_associations(association):

0 commit comments

Comments
 (0)