Run formatting / fix lint errors
Some checks failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint Pipeline failed
ci/woodpecker/push/tests Pipeline was successful

This commit is contained in:
Sonny Bakker 2025-03-28 21:41:47 +01:00
parent b8559f0499
commit bfd081337b
9 changed files with 44 additions and 46 deletions

View file

@ -4,18 +4,17 @@ from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('accounts', '0017_auto_20240906_0914'),
("accounts", "0017_auto_20240906_0914"),
]
operations = [
migrations.RemoveField(
model_name='user',
name='reddit_access_token',
model_name="user",
name="reddit_access_token",
),
migrations.RemoveField(
model_name='user',
name='reddit_refresh_token',
model_name="user",
name="reddit_refresh_token",
),
]

View file

@ -4,43 +4,44 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('collection', '0017_remove_collectionrule_timezone'),
("collection", "0017_remove_collectionrule_timezone"),
]
operations = [
migrations.RemoveField(
model_name='collectionrule',
name='reddit_allow_nfsw',
model_name="collectionrule",
name="reddit_allow_nfsw",
),
migrations.RemoveField(
model_name='collectionrule',
name='reddit_allow_spoiler',
model_name="collectionrule",
name="reddit_allow_spoiler",
),
migrations.RemoveField(
model_name='collectionrule',
name='reddit_allow_viewed',
model_name="collectionrule",
name="reddit_allow_viewed",
),
migrations.RemoveField(
model_name='collectionrule',
name='reddit_comments_min',
model_name="collectionrule",
name="reddit_comments_min",
),
migrations.RemoveField(
model_name='collectionrule',
name='reddit_downvotes_max',
model_name="collectionrule",
name="reddit_downvotes_max",
),
migrations.RemoveField(
model_name='collectionrule',
name='reddit_upvotes_min',
model_name="collectionrule",
name="reddit_upvotes_min",
),
migrations.RemoveField(
model_name='collectionrule',
name='screen_name',
model_name="collectionrule",
name="screen_name",
),
migrations.AlterField(
model_name='collectionrule',
name='type',
field=models.CharField(choices=[('feed', 'Feed')], default='feed', max_length=20),
model_name="collectionrule",
name="type",
field=models.CharField(
choices=[("feed", "Feed")], default="feed", max_length=20
),
),
]

View file

@ -1,5 +1,4 @@
from django.core.exceptions import ObjectDoesNotExist
from django.utils.translation import gettext as _
from celery.exceptions import Reject
from celery.utils.log import get_task_logger

View file

@ -44,7 +44,7 @@ feed_mock = {
"base": "http://feeds.bbci.co.uk/news/rss.xml",
"language": None,
"type": "text/plain",
"value": "Trump's genocidal taunts will not " "end Iran - Zarif",
"value": "Trump's genocidal taunts will not end Iran - Zarif",
},
},
{
@ -83,7 +83,7 @@ feed_mock = {
"base": "http://feeds.bbci.co.uk/news/rss.xml",
"language": None,
"type": "text/plain",
"value": "Huawei's Android loss: How it " "affects you",
"value": "Huawei's Android loss: How it affects you",
},
},
{
@ -124,7 +124,7 @@ feed_mock = {
"base": "http://feeds.bbci.co.uk/news/rss.xml",
"language": None,
"type": "text/plain",
"value": "Birmingham head teacher threatened " "over LGBT lessons",
"value": "Birmingham head teacher threatened over LGBT lessons",
},
},
],

View file

@ -42,7 +42,7 @@ simple_mock = {
"base": "http://feeds.bbci.co.uk/news/rss.xml",
"language": None,
"type": "text/plain",
"value": "Trump's 'genocidal taunts' will not " "end Iran - Zarif",
"value": "Trump's 'genocidal taunts' will not end Iran - Zarif",
},
}
],

View file

@ -42,7 +42,7 @@ multiple_mock = {
"base": "http://feeds.bbci.co.uk/news/rss.xml",
"language": None,
"type": "text/plain",
"value": "Trump's 'genocidal taunts' will not " "end Iran - Zarif",
"value": "Trump's 'genocidal taunts' will not end Iran - Zarif",
},
},
{
@ -81,7 +81,7 @@ multiple_mock = {
"base": "http://feeds.bbci.co.uk/news/rss.xml",
"language": None,
"type": "text/plain",
"value": "Huawei's Android loss: How it " "affects you",
"value": "Huawei's Android loss: How it affects you",
},
},
{
@ -122,7 +122,7 @@ multiple_mock = {
"base": "http://feeds.bbci.co.uk/news/rss.xml",
"language": None,
"type": "text/plain",
"value": "Birmingham head teacher threatened " "over LGBT lessons",
"value": "Birmingham head teacher threatened over LGBT lessons",
},
},
],
@ -212,7 +212,7 @@ duplicate_mock = {
"base": "http://feeds.bbci.co.uk/news/rss.xml",
"language": None,
"type": "text/plain",
"value": "Trump's 'genocidal taunts' will not " "end Iran - Zarif",
"value": "Trump's 'genocidal taunts' will not end Iran - Zarif",
},
},
{
@ -250,7 +250,7 @@ duplicate_mock = {
"base": "http://feeds.bbci.co.uk/news/rss.xml",
"language": None,
"type": "text/plain",
"value": "Huawei's Android loss: How it " "affects you",
"value": "Huawei's Android loss: How it affects you",
},
},
{
@ -290,7 +290,7 @@ duplicate_mock = {
"base": "http://feeds.bbci.co.uk/news/rss.xml",
"language": None,
"type": "text/plain",
"value": "Birmingham head teacher threatened " "over LGBT lessons",
"value": "Birmingham head teacher threatened over LGBT lessons",
},
},
],
@ -356,7 +356,7 @@ multiple_update_mock = {
"base": "http://feeds.bbci.co.uk/news/rss.xml",
"language": None,
"type": "text/plain",
"value": "Trump's 'genocidal taunts' will not " "end Iran - Zarif",
"value": "Trump's 'genocidal taunts' will not end Iran - Zarif",
},
},
{
@ -395,7 +395,7 @@ multiple_update_mock = {
"base": "http://feeds.bbci.co.uk/news/rss.xml",
"language": None,
"type": "text/plain",
"value": "Huawei's Android loss: How it " "affects you",
"value": "Huawei's Android loss: How it affects you",
},
},
{
@ -436,7 +436,7 @@ multiple_update_mock = {
"base": "http://feeds.bbci.co.uk/news/rss.xml",
"language": None,
"type": "text/plain",
"value": "Birmingham head teacher threatened " "over LGBT lessons",
"value": "Birmingham head teacher threatened over LGBT lessons",
},
},
],

View file

@ -73,12 +73,12 @@ simple_mock_parsed = {
"not think face coverings should be "
"mandatory in shops in England.",
},
"title": "Coronavirus: I trust people's sense on face masks - " "Gove",
"title": "Coronavirus: I trust people's sense on face masks - Gove",
"title_detail": {
"base": "",
"language": None,
"type": "text/plain",
"value": "Coronavirus: I trust people's sense " "on face masks - Gove",
"value": "Coronavirus: I trust people's sense on face masks - Gove",
},
},
{
@ -109,7 +109,7 @@ simple_mock_parsed = {
"base": "",
"language": None,
"type": "text/plain",
"value": "Farm outbreak leads 200 to self " "isolate",
"value": "Farm outbreak leads 200 to self isolate",
},
},
{
@ -137,12 +137,12 @@ simple_mock_parsed = {
"talks on tackling people "
"smuggling.",
},
"title": "English Channel search operation after migrant " "crossings",
"title": "English Channel search operation after migrant crossings",
"title_detail": {
"base": "",
"language": None,
"type": "text/plain",
"value": "English Channel search operation " "after migrant crossings",
"value": "English Channel search operation after migrant crossings",
},
},
],

View file

@ -60,6 +60,6 @@ def truncate_text(cls, field_name, value):
return value
if len(value) > max_length:
return f"{value[:max_length - 1]}"
return f"{value[: max_length - 1]}"
return value

View file

@ -3,7 +3,6 @@ from newsreader.news.collection.views.feed import (
FeedUpdateView,
OPMLImportView,
)
from newsreader.news.collection.views.rules import (
CollectionRuleBulkDeleteView,
CollectionRuleBulkDisableView,