Did get_profile more general with bind_vars

pull/5/head
Lasse Edfast 5 years ago
parent c38e756566
commit 0feb32d0b4
  1. 9
      facebook/arangodb.py

@ -45,15 +45,16 @@ def write_report(users, pictures):
})
def get_profile():
""" Hämtar profil om det inte gjorts förut """
def get_profile(created=True):
""" Hämtar profil från profiles """
cursor = db.aql.execute(
"""
FOR doc IN profiles
FILTER doc.in_use == false
FILTER doc.created == true
FILTER doc.created == @created
RETURN doc
"""
""",
bind_vars={'created': created}
)
return cursor.next()

Loading…
Cancel
Save