Commit Graph

15 Commits

Author SHA1 Message Date
Jelle van der Waa
bee08575b7 ruff.toml: enable RSE plugin 2024-05-31 21:44:00 +02:00
Jelle van der Waa
b701538d46 planet: tests require a real django model 2024-05-31 21:17:06 +02:00
Jelle van der Waa
6b43ce1407 ruff: enable isort rule 2023-11-03 12:35:59 +01:00
Jelle van der Waa
54c331c17b Move from pytz to zoneinfo
Since Python 3.9 zoneinfo is available and datetime also has a timezone
module attribute which can be used. Also refactor the
utcnow/fromutctimestamp usage to according to this excellent blogpost.

https://blog.ganssle.io/articles/2019/11/utcnow.html
2023-02-14 20:21:47 +01:00
Jelle van der Waa
e36eaddbc0
Add missing django migrations
Closes: #410
2022-06-20 21:13:22 +02:00
Grégoire Deveaux
5c5a455458 Mutualize commands logger configs 2022-01-09 19:14:55 +01:00
Grégoire Deveaux
40bfcc104c Add author to planet feed 2021-12-20 21:18:10 +01:00
Jelle van der Waa
1c16824206
Port planet tests to pytest 2021-09-19 23:06:35 +02:00
Jelle van der Waa
91fba37a87
planet: resovle django 3.2 valuerrror
bulk_create() prohibited to prevent data loss due to unsaved related object 'feed'.
2021-04-12 21:51:27 +02:00
Jelle van der Waa
d8f558753e Handle 301 when updating planet feeds
When a 301 is returned the callee is expected to update it's database
entry to reflect this change. As subsequent returning requests to the
old url might lead to ip bans.
2020-11-26 21:13:00 +01:00
Justin !
093e4f4c1f Unlint more migrations 2020-11-11 22:23:29 +01:00
Justin !
c6cf91a40d Fix pep8 errors 2020-11-11 22:23:29 +01:00
Jelle van der Waa
e3b419bcfe planet: add tests for updating planet 2020-03-06 22:54:46 +01:00
Jelle van der Waa
6c796fce1d planet: handle response without 'status'
feedparser's parse method returns an arbitrary dictionary which may or
may not have the HTTP status. Rely on get() to return None if it's
lacking and then return and log a message.
2020-03-05 21:28:37 +01:00
Jelle van der Waa
17a12f07fb Introduce planet functionality in archweb
This change introduces a replacment for planet.archlinux.org which uses
a python 2 project to generate static html from multiple RSS feed
sources. For archweb a set of 'static' feeds can be created in the
django admin view for the Arch forums and other static feeds, archweb
users can add their own blog rss feed in their profile which will create
a Feed model.

When running the update_planet command, all Feed models are iterated
over and the rss feed is parsed. The latest FeedItem is queried matching
the current Feed model and every newer entry in the RSS feed is added as
new FeedItem. Since the body is also stored in the FeedItem there is a
limit to the amount of FeedItems per Feed configured in settings.py of
which the default is 25.

When a user is marked as inactive his Feed model and items are
removed automatically to avoid keeping stale data around.

Closes: #261
2020-02-03 21:25:31 +01:00