Add more Ruff rules (#891)

* ruff: apply rule F

* ruff: apply rule E

* ruff: apply rule SIM

* ruff: apply rule TCH

* ruff: apply rule ERA

* ruff: apply rule PLW

* ruff: apply rule FLY

* ruff: apply rule PERF

* ruff: apply rules FURB & RUF
This commit is contained in:
thomas girod
2024-10-15 11:36:26 +02:00
committed by GitHub
parent d114b01bcc
commit d16a207a83
82 changed files with 836 additions and 748 deletions

View File

@ -23,7 +23,26 @@
from django.urls import path
from forum.views import *
from forum.views import (
ForumCreateView,
ForumDeleteView,
ForumDetailView,
ForumEditView,
ForumFavoriteTopics,
ForumLastUnread,
ForumMainView,
ForumMarkAllAsRead,
ForumMessageCreateView,
ForumMessageDeleteView,
ForumMessageEditView,
ForumMessageUndeleteView,
ForumMessageView,
ForumSearchView,
ForumTopicCreateView,
ForumTopicDetailView,
ForumTopicEditView,
ForumTopicSubscribeView,
)
urlpatterns = [
path("", ForumMainView.as_view(), name="main"),
@ -35,21 +54,9 @@ urlpatterns = [
path("<int:forum_id>/", ForumDetailView.as_view(), name="view_forum"),
path("<int:forum_id>/edit/", ForumEditView.as_view(), name="edit_forum"),
path("<int:forum_id>/delete/", ForumDeleteView.as_view(), name="delete_forum"),
path(
"<int:forum_id>/new_topic/",
ForumTopicCreateView.as_view(),
name="new_topic",
),
path(
"topic/<int:topic_id>/",
ForumTopicDetailView.as_view(),
name="view_topic",
),
path(
"topic/<int:topic_id>/edit/",
ForumTopicEditView.as_view(),
name="edit_topic",
),
path("<int:forum_id>/new_topic/", ForumTopicCreateView.as_view(), name="new_topic"),
path("topic/<int:topic_id>/", ForumTopicDetailView.as_view(), name="view_topic"),
path("topic/<int:topic_id>/edit/", ForumTopicEditView.as_view(), name="edit_topic"),
path(
"topic/<int:topic_id>/new_message/",
ForumMessageCreateView.as_view(),
@ -60,11 +67,7 @@ urlpatterns = [
ForumTopicSubscribeView.as_view(),
name="toggle_subscribe_topic",
),
path(
"message/<int:message_id>/",
ForumMessageView.as_view(),
name="view_message",
),
path("message/<int:message_id>/", ForumMessageView.as_view(), name="view_message"),
path(
"message/<int:message_id>/edit/",
ForumMessageEditView.as_view(),