c4tk / prayerbot

Prayer helping bot for Facebook Messenger
6 stars 6 forks source link

There's a problem with limiting number of existing prayer intents. #13

Closed kubaodias closed 8 years ago

kubaodias commented 8 years ago
2016-06-18T20:26:08.84+0200 [App/0]      OUT Webhook request data: {"object":"page","entry":[{"id":"215380638847054","time":1466274368419,"messaging":[{"sender":{"id":"10208414992228182"},"recipient":{"id":"215380638847054"},"timestamp":1466274368419,"postback":{"payload":"{\"user_event\": \"want_to_pray\"}"}}]}]}
2016-06-18T20:26:08.86+0200 [App/0]      ERR [2016-06-18 18:26:08,856] ERROR in app: Exception on /webhook [POST]
2016-06-18T20:26:08.86+0200 [App/0]      ERR Traceback (most recent call last):
2016-06-18T20:26:08.86+0200 [App/0]      ERR   File "/app/.heroku/python/lib/python2.7/site-packages/flask/app.py", line 1988, in wsgi_app
2016-06-18T20:26:08.86+0200 [App/0]      ERR     response = self.full_dispatch_request()
2016-06-18T20:26:08.86+0200 [App/0]      ERR   File "/app/.heroku/python/lib/python2.7/site-packages/flask/app.py", line 1641, in full_dispatch_request
2016-06-18T20:26:08.86+0200 [App/0]      ERR     rv = self.handle_user_exception(e)
2016-06-18T20:26:08.86+0200 [App/0]      ERR   File "/app/.heroku/python/lib/python2.7/site-packages/flask/app.py", line 1544, in handle_user_exception
2016-06-18T20:26:08.86+0200 [App/0]      ERR     reraise(exc_type, exc_value, tb)
2016-06-18T20:26:08.86+0200 [App/0]      ERR   File "/app/.heroku/python/lib/python2.7/site-packages/flask/app.py", line 1639, in full_dispatch_request
2016-06-18T20:26:08.86+0200 [App/0]      ERR     rv = self.dispatch_request()
2016-06-18T20:26:08.86+0200 [App/0]      ERR   File "/app/.heroku/python/lib/python2.7/site-packages/flask/app.py", line 1625, in dispatch_request
2016-06-18T20:26:08.86+0200 [App/0]      ERR     return self.view_functions[rule.endpoint](**req.view_args)
2016-06-18T20:26:08.86+0200 [App/0]      ERR   File "/app/.heroku/python/lib/python2.7/site-packages/flask/views.py", line 84, in view
2016-06-18T20:26:08.86+0200 [App/0]      ERR     return self.dispatch_request(*args, **kwargs)
2016-06-18T20:26:08.86+0200 [App/0]      ERR   File "/app/.heroku/python/lib/python2.7/site-packages/flask/views.py", line 149, in dispatch_request
2016-06-18T20:26:08.86+0200 [App/0]      ERR     return meth(*args, **kwargs)
2016-06-18T20:26:08.86+0200 [App/0]      ERR   File "/home/vcap/app/web.py", line 54, in post
2016-06-18T20:26:08.86+0200 [App/0]      ERR     response_callbacks = webhook.handle_postback(event['sender'], event['postback'])
2016-06-18T20:26:08.86+0200 [App/0]      ERR   File "/home/vcap/app/prayer.py", line 101, in handle_postback
2016-06-18T20:26:08.86+0200 [App/0]      ERR     callbacks = PrayerWebhook.handle_user_event(sender_id, event_type, payload)
2016-06-18T20:26:08.86+0200 [App/0]      ERR   File "/home/vcap/app/prayer.py", line 148, in handle_user_event
2016-06-18T20:26:08.86+0200 [App/0]      ERR     prayers = Intent.query.all().limit(displayed_prayers_limit)
2016-06-18T20:26:08.86+0200 [App/0]      ERR AttributeError: 'list' object has no attribute 'limit'