Feature #2597
Feature #2461: Add Berean Study Bible
Export fails
Start date:
02/10/2020
Due date:
% Done:
100%
Associated revisions
Fixing error that prevents epub export
Reference #2597
Adding test for epub creation
Reference #2597
Fixing export problems
Reference #2597
History
#1 Updated by Luke Murphey almost 5 years ago
Internal Server Error: /download/work/berean-bible Traceback (most recent call last): File "/usr/local/lib/python3.7/site-packages/django/core/handlers/exception.py", line 41, in inner response = get_response(request) File "/usr/local/lib/python3.7/site-packages/django/core/handlers/base.py", line 249, in _legacy_get_response response = self._get_response(request) File "/usr/local/lib/python3.7/site-packages/django/core/handlers/base.py", line 187, in _get_response response = self.process_exception_by_middleware(e, request) File "/usr/local/lib/python3.7/site-packages/django/core/handlers/base.py", line 185, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/usr/src/app/reader/views.py", line 372, in download_work fname = ePubExport.exportWork(work, epub_file_full_path) File "/usr/src/app/reader/ebook/__init__.py", line 297, in exportWork new_division = cls.exportDivision(book, division, division_parents[-1]) File "/usr/src/app/reader/ebook/__init__.py", line 423, in exportDivision html = template.render(c).encode("utf-8") File "/usr/local/lib/python3.7/site-packages/django/template/backends/django.py", line 66, in render return self.template.render(context) File "/usr/local/lib/python3.7/site-packages/django/template/base.py", line 207, in render return self._render(context) File "/usr/local/lib/python3.7/site-packages/django/template/base.py", line 199, in _render return self.nodelist.render(context) File "/usr/local/lib/python3.7/site-packages/django/template/base.py", line 990, in render bit = node.render_annotated(context) File "/usr/local/lib/python3.7/site-packages/django/template/base.py", line 957, in render_annotated return self.render(context) File "/usr/local/lib/python3.7/site-packages/django/template/loader_tags.py", line 177, in render return compiled_parent._render(context) File "/usr/local/lib/python3.7/site-packages/django/template/base.py", line 199, in _render return self.nodelist.render(context) File "/usr/local/lib/python3.7/site-packages/django/template/base.py", line 990, in render bit = node.render_annotated(context) File "/usr/local/lib/python3.7/site-packages/django/template/base.py", line 957, in render_annotated return self.render(context) File "/usr/local/lib/python3.7/site-packages/django/template/loader_tags.py", line 72, in render result = block.nodelist.render(context) File "/usr/local/lib/python3.7/site-packages/django/template/base.py", line 990, in render bit = node.render_annotated(context) File "/usr/local/lib/python3.7/site-packages/django/template/base.py", line 957, in render_annotated return self.render(context) File "/usr/local/lib/python3.7/site-packages/django/template/base.py", line 1040, in render output = self.filter_expression.resolve(context) File "/usr/local/lib/python3.7/site-packages/django/template/base.py", line 736, in resolve new_obj = func(obj, *arg_vals) File "/usr/src/app/reader/templatetags/string_utils.py", line 89, in replace return value.replace(replace_this, put_in_this) AttributeError: 'Division' object has no attribute 'replace'Qs:
- Does export still work for other works?
- No
- Why does this work on the read work page?
- Is the template engine supposed to stringify everything for me?
- Are others seeing the same issue?
- What part of the template is failing?
- <h2>{{chapter|replace:"βοοκ,Book"|capfirst}}</h2>
- Changing the order makes this work. It appears that the template engine does not force the incoming data into a string. This actually makes sense.
- Calling str on the object doesn't fix it
- I'm guessing the str function is returning the actual division somehow
- Removing the str function from the Division model doesn't fix it
- Division model is not returning a str from str
- Removing str changed the behavior
- Which part of the str branch has the issue?
- None are having issues now
- However, the division titles are wrong
- I'm using the template engine wrong
#2 Updated by Luke Murphey almost 5 years ago
- Status changed from New to Closed
- % Done changed from 0 to 100