Bug#1010273: Possible solution: add --clear flag to collectstatic

2023-11-29 Thread Pierre-Elliott Bécue
Marco Steinacher  wrote on 29/11/2023 at 09:25:03+0100:

> Hi again,
>
> Here is an update to my previous message:
>
> I think the easiest workaround is to add the --clear flag to the
> collectstatic command, i.e.
>
> www-data@mail:/usr/share/mailman3-web$ ./manage.py collectstatic --clear
> www-data@mail:/usr/share/mailman3-web$ ./manage.py compress
>
> With the --clear flag the existing files are deleted before trying to
> copy the original file.
> https://docs.djangoproject.com/en/4.2/ref/contrib/staticfiles/#collectstatic
>
> This should solve the problem of old static files not being updated
> because of source files that are older than the files installed by the
> previous version.
>
> The --clear flag should probably be added to
> debian/mailman3-web.postinst in update_django(), line 198, to fix the
> problem in the mailman3-web Debian
> package. 
> https://salsa.debian.org/mailman-team/mailman-suite/-/blob/master/debian/mailman3-web.postinst#L198
>
> Marco

Hello,

I saw this bug report, but I admit it slipped out of my mind.

I have updated the django-mailman3 package recently and was planning to
finish with a sweep on postorius and hyperkitty and then the web package.

I'll include these fixes, and then try to have the relevant fixes
backported into bookworm via a stable upload.

Thanks for your mails.
-- 
PEB


signature.asc
Description: PGP signature


Bug#1010273: Possible solution: add --clear flag to collectstatic

2023-11-29 Thread Marco Steinacher

Hi again,

Here is an update to my previous message:

I think the easiest workaround is to add the --clear flag to the 
collectstatic command, i.e.


www-data@mail:/usr/share/mailman3-web$ ./manage.py collectstatic --clear
www-data@mail:/usr/share/mailman3-web$ ./manage.py compress

With the --clear flag the existing files are deleted before trying to 
copy the original file.

https://docs.djangoproject.com/en/4.2/ref/contrib/staticfiles/#collectstatic

This should solve the problem of old static files not being updated 
because of source files that are older than the files installed by the 
previous version.


The --clear flag should probably be added to 
debian/mailman3-web.postinst in update_django(), line 198, to fix the 
problem in the mailman3-web Debian package. 
https://salsa.debian.org/mailman-team/mailman-suite/-/blob/master/debian/mailman3-web.postinst#L198


Marco
--
OpenPGP Key ID: 0x62937F7F