Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generating blank pdfs does not work #38

Open
christofsteel opened this issue Sep 16, 2015 · 0 comments
Open

Generating blank pdfs does not work #38

christofsteel opened this issue Sep 16, 2015 · 0 comments

Comments

@christofsteel
Copy link

When generating blank pdfs, I get an Internal Server Error. When analyzing the error I found it to be twofold:

First, _pdfblankgen() wants two parameters: count and game, but getpdf calls it with req, count and game. This raises an error which is caught and handeled by return error(req, u"Das war keine Zahl...") which is wrapped in your custom handler function and then failes with

[Wed Sep 16 18:58:41.886961 2015] [wsgi:error] [pid 23457:tid 140137052333824] ERROR:moerderspiel:Exception on /pdfget [POST]
[Wed Sep 16 18:58:41.886991 2015] [wsgi:error] [pid 23457:tid 140137052333824] Traceback (most recent call last):
[Wed Sep 16 18:58:41.887005 2015] [wsgi:error] [pid 23457:tid 140137052333824]   File "/srv/http/moerderspiel/venv/lib/python2.7/site-packages/flask/app.py", line 1817, in wsgi_app
[Wed Sep 16 18:58:41.887008 2015] [wsgi:error] [pid 23457:tid 140137052333824]     response = self.full_dispatch_request()
[Wed Sep 16 18:58:41.887011 2015] [wsgi:error] [pid 23457:tid 140137052333824]   File "/srv/http/moerderspiel/venv/lib/python2.7/site-packages/flask/app.py", line 1477, in full_dispatch_request
[Wed Sep 16 18:58:41.887013 2015] [wsgi:error] [pid 23457:tid 140137052333824]     rv = self.handle_user_exception(e)
[Wed Sep 16 18:58:41.887016 2015] [wsgi:error] [pid 23457:tid 140137052333824]   File "/srv/http/moerderspiel/venv/lib/python2.7/site-packages/flask/app.py", line 1381, in handle_user_exception
[Wed Sep 16 18:58:41.887018 2015] [wsgi:error] [pid 23457:tid 140137052333824]     reraise(exc_type, exc_value, tb)
[Wed Sep 16 18:58:41.887020 2015] [wsgi:error] [pid 23457:tid 140137052333824]   File "/srv/http/moerderspiel/venv/lib/python2.7/site-packages/flask/app.py", line 1475, in full_dispatch_request
[Wed Sep 16 18:58:41.887023 2015] [wsgi:error] [pid 23457:tid 140137052333824]     rv = self.dispatch_request()
[Wed Sep 16 18:58:41.887025 2015] [wsgi:error] [pid 23457:tid 140137052333824]   File "/srv/http/moerderspiel/venv/lib/python2.7/site-packages/flask/app.py", line 1461, in dispatch_request
[Wed Sep 16 18:58:41.887027 2015] [wsgi:error] [pid 23457:tid 140137052333824]     return self.view_functions[rule.endpoint](**req.view_args)
[Wed Sep 16 18:58:41.887030 2015] [wsgi:error] [pid 23457:tid 140137052333824]   File "/srv/http/moerderspiel/moerderspiel.py", line 84, in handler
[Wed Sep 16 18:58:41.887032 2015] [wsgi:error] [pid 23457:tid 140137052333824]     return f(**a)
[Wed Sep 16 18:58:41.887034 2015] [wsgi:error] [pid 23457:tid 140137052333824]   File "/srv/http/moerderspiel/moerderspiel.py", line 509, in pdfget
[Wed Sep 16 18:58:41.887036 2015] [wsgi:error] [pid 23457:tid 140137052333824]     return error(req, u"Das war keine Zahl...")
[Wed Sep 16 18:58:41.887039 2015] [wsgi:error] [pid 23457:tid 140137052333824]   File "/srv/http/moerderspiel/moerderspiel.py", line 84, in handler
[Wed Sep 16 18:58:41.887041 2015] [wsgi:error] [pid 23457:tid 140137052333824]     return f(**a)
[Wed Sep 16 18:58:41.887043 2015] [wsgi:error] [pid 23457:tid 140137052333824] TypeError: error() got an unexpected keyword argument 'count'

Replacing _pdfblankgen(req, int(count), game) with _pdfblankgen(int(count), game) should take care of the first issue so that the second issue does not occure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant