Hi again,
I had the problem with getting two footers, i.e. two expansions of the template. After some digging in the source code I found out that the decorator made one expansion (without personalization) and that the delivery handling made another (with personalization). So I hacked pipelines/builtin.py with a new pipeline that excluded the decorate step, recompiled and changed to that pipeline for my personalized list. That worked. Nothing like a bit of shotgun debugging in production.
That solves my immediate problem. Is there a known and recommended way of configuring personalized delivery so that you only get the personalized footer? I have ideas, but I probably should share them with the developer list instead. :-)
Of course this very nice functionality is a bit buried. I activated it using the interactive python shell, seems less risky than changing the database directly.
Cheers // David
On Sat, Sep 23, 2017 at 10:39 PM, David Krantz <gazorg@gmail.com> wrote:
On Sat, Sep 23, 2017 at 6:48 PM, Mark Sapiro <mark@msapiro.net> wrote:
Have you tried restarting/reloading whatever dbm (MySQL, PostgreSQL, ?) you are using?
No, that would have been strange to me; the table in the database was up to date. But now I tried that, I got no effect this time but I probably could set up a better test.
I also had another problem [solved]: I get the error message "Multiple rows were found for one_or_none" when I try TemplateManager.get(name, context) for the list. There is only one matching row in the templates table so something is fishy with the ORM. This occured when I changed to the previous uri value. As the database does not have any duplicates in the templates table I suspect either a broken join or that the cache retains the old value.
tm.get('list:member:regular:footer', 'test.example.com') Traceback (most recent call last): File "<console>", line 1, in <module> File ".../venv-3.5/lib/python3.5/site-packages/mailman-3.2.0a1-py3.5.egg/mailman/database/transaction.py",
The traceback looks like this in the mailman shell: line 85, in wrapper return function(args[0], config.db.store, *args[1:], **kws) File ".../venv-3.5/lib/python3.5/site-packages/mailman-3.2.0a1-py3.5.egg/mailman/model/template.py", line 98, in get contents = cache_mgr.get(actual_uri) File ".../venv-3.5/lib/python3.5/site-packages/mailman-3.2.0a1-py3.5.egg/mailman/database/transaction.py", line 85, in wrapper return function(args[0], config.db.store, *args[1:], **kws) File ".../venv-3.5/lib/python3.5/site-packages/mailman-3.2.0a1-py3.5.egg/mailman/model/cache.py", line 125, in get CacheEntry.key == key).one_or_none() File ".../venv-3.5/lib/python3.5/site-packages/SQLAlchemy-1.2.0b2-py3.5-linux-x86_64.egg/sqlalchemy/orm/query.py", line 2814, in one_or_none "Multiple rows were found for one_or_none()") sqlalchemy.orm.exc.MultipleResultsFound: Multiple rows were found for one_or_none()
Workaround: Delete cached files in .../var/cache and run delete from file_cache in postgresql. Then that works again. The culprit was that the file got cached twice so there is a bug in the cache function. I used the ITemplateManager-util in the shell to cause the problem.
- the $user_delivered_to and $user_email do not expand for some reason. Known problem?
These require that the list delivery be personalized. See <http://mailman.readthedocs.io/en/latest/src/mailman/runners/docs/outgoing.html#personalization>.
That explains things. Thank you!
Now I got two footers, first one without personalisation and one personalised. Interesting.
best regards // David