neo4j-flask icon indicating copy to clipboard operation
neo4j-flask copied to clipboard

Change syntax of "next" in get_commonality_of_user for py2neo v4

Open seanofahey opened this issue 6 years ago • 0 comments

First thanks for the code and tutorial -- they are both very helpful.

Issue:

  • When logged in as a user and looking at the profile page of another user, the system does not correctly display the number of likes or the common tags.

Potential Cause:

  • the return call on the get_commonality_of_user method in models.py uses the following syntax:

return graph.run(query, they=other.username, you=self.username).next

Fix: Modify the return call to be: return graph.run(query, they=other.username, you=self.username).next()

or wrap it with: return next(graph.run(query, they=other.username, you=self.username))

seanofahey avatar Dec 26 '18 16:12 seanofahey