Skip to content

Commit 826510f

Browse files
author
Neil Fraser
authored
fix: Preemptively fix API change in NDB. (#7361)
Glockenspiel broke due to 'query' now being required within a client context. This change fixed Glockenspiel. Blockly samples doesn't appear to be broken yet, but Glokenspeil broke at midnight yesterday. Similar change being made to Blockly Games.
1 parent 2a2b3b3 commit 826510f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

appengine/storage.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ def xmlToKey(xml_content):
4444
# Store XML and return a generated key.
4545
xml_hash = int(hashlib.sha1(xml_content.encode("utf-8")).hexdigest(), 16)
4646
xml_hash = int(xml_hash % (2 ** 64) - (2 ** 63))
47-
lookup_query = Xml.query(Xml.xml_hash == xml_hash)
4847
client = ndb.Client()
4948
with client.context():
49+
lookup_query = Xml.query(Xml.xml_hash == xml_hash)
5050
lookup_result = lookup_query.get()
5151
if lookup_result:
5252
xml_key = lookup_result.key.string_id()

0 commit comments

Comments
 (0)