From 13938858c4e3b4c4e632b569e4be8face7145b19 Mon Sep 17 00:00:00 2001 From: Mads Nylund <73914541+MadsNyl@users.noreply.github.com> Date: Fri, 11 Oct 2024 18:31:17 +0200 Subject: [PATCH] Renaming of index app to feedback (#901) renamed index app to feedback --- app/{index => feedback}/__init__.py | 0 app/{index/admin => feedback}/admin.py | 2 +- app/feedback/app.py | 5 +++++ app/{index => feedback}/enums.py | 0 app/{index => feedback}/exceptions.py | 0 app/feedback/factories/__init__.py | 2 ++ app/{index => feedback}/factories/bug_factory.py | 2 +- app/{index => feedback}/factories/idea_factory.py | 2 +- app/{index/admin => feedback/filters}/__init__.py | 0 app/{index => feedback}/migrations/0001_initial.py | 10 +++++----- app/{index/filters => feedback/migrations}/__init__.py | 0 app/{index => feedback}/mixins.py | 0 app/feedback/models/__init__.py | 3 +++ app/feedback/models/bug.py | 5 +++++ app/{index => feedback}/models/feedback.py | 2 +- app/feedback/models/idea.py | 5 +++++ app/feedback/serializers/__init__.py | 3 +++ app/{index => feedback}/serializers/bug.py | 2 +- app/{index => feedback}/serializers/feedback.py | 4 ++-- app/{index => feedback}/serializers/idea.py | 2 +- app/{index/migrations => feedback/tasks}/__init__.py | 0 app/{index/tasks => feedback/tests}/__init__.py | 0 app/{index => feedback}/urls.py | 2 +- app/{index/tests => feedback/util}/__init__.py | 0 app/{index/util => feedback/views}/__init__.py | 0 app/{index => feedback}/views/feedback.py | 4 ++-- app/index/app.py | 5 ----- app/index/factories/__init__.py | 2 -- app/index/models/__init__.py | 3 --- app/index/models/bug.py | 5 ----- app/index/models/idea.py | 5 ----- app/index/serializers/__init__.py | 3 --- app/index/views/__init__.py | 0 app/settings.py | 2 +- app/tests/conftest.py | 2 +- app/tests/index/test_feedback_integration.py | 2 +- app/urls.py | 2 +- 37 files changed, 43 insertions(+), 43 deletions(-) rename app/{index => feedback}/__init__.py (100%) rename app/{index/admin => feedback}/admin.py (67%) create mode 100644 app/feedback/app.py rename app/{index => feedback}/enums.py (100%) rename app/{index => feedback}/exceptions.py (100%) create mode 100644 app/feedback/factories/__init__.py rename app/{index => feedback}/factories/bug_factory.py (87%) rename app/{index => feedback}/factories/idea_factory.py (87%) rename app/{index/admin => feedback/filters}/__init__.py (100%) rename app/{index => feedback}/migrations/0001_initial.py (93%) rename app/{index/filters => feedback/migrations}/__init__.py (100%) rename app/{index => feedback}/mixins.py (100%) create mode 100644 app/feedback/models/__init__.py create mode 100644 app/feedback/models/bug.py rename app/{index => feedback}/models/feedback.py (98%) create mode 100644 app/feedback/models/idea.py create mode 100644 app/feedback/serializers/__init__.py rename app/{index => feedback}/serializers/bug.py (90%) rename app/{index => feedback}/serializers/feedback.py (93%) rename app/{index => feedback}/serializers/idea.py (90%) rename app/{index/migrations => feedback/tasks}/__init__.py (100%) rename app/{index/tasks => feedback/tests}/__init__.py (100%) rename app/{index => feedback}/urls.py (78%) rename app/{index/tests => feedback/util}/__init__.py (100%) rename app/{index/util => feedback/views}/__init__.py (100%) rename app/{index => feedback}/views/feedback.py (96%) delete mode 100644 app/index/app.py delete mode 100644 app/index/factories/__init__.py delete mode 100644 app/index/models/__init__.py delete mode 100644 app/index/models/bug.py delete mode 100644 app/index/models/idea.py delete mode 100644 app/index/serializers/__init__.py delete mode 100644 app/index/views/__init__.py diff --git a/app/index/__init__.py b/app/feedback/__init__.py similarity index 100% rename from app/index/__init__.py rename to app/feedback/__init__.py diff --git a/app/index/admin/admin.py b/app/feedback/admin.py similarity index 67% rename from app/index/admin/admin.py rename to app/feedback/admin.py index ebcfc4b4c..3f450ab77 100644 --- a/app/index/admin/admin.py +++ b/app/feedback/admin.py @@ -1,5 +1,5 @@ from django.contrib import admin -from app.index import models +from app.feedback import models admin.site.register(models.Bug) diff --git a/app/feedback/app.py b/app/feedback/app.py new file mode 100644 index 000000000..c310f0d3f --- /dev/null +++ b/app/feedback/app.py @@ -0,0 +1,5 @@ +from django.apps import AppConfig + + +class FeedbackConfig(AppConfig): + name = "app.feedback" diff --git a/app/index/enums.py b/app/feedback/enums.py similarity index 100% rename from app/index/enums.py rename to app/feedback/enums.py diff --git a/app/index/exceptions.py b/app/feedback/exceptions.py similarity index 100% rename from app/index/exceptions.py rename to app/feedback/exceptions.py diff --git a/app/feedback/factories/__init__.py b/app/feedback/factories/__init__.py new file mode 100644 index 000000000..6dba01612 --- /dev/null +++ b/app/feedback/factories/__init__.py @@ -0,0 +1,2 @@ +from app.feedback.factories.bug_factory import BugFactory +from app.feedback.factories.idea_factory import IdeaFactory diff --git a/app/index/factories/bug_factory.py b/app/feedback/factories/bug_factory.py similarity index 87% rename from app/index/factories/bug_factory.py rename to app/feedback/factories/bug_factory.py index cd84aa3f3..4ff95a210 100644 --- a/app/index/factories/bug_factory.py +++ b/app/feedback/factories/bug_factory.py @@ -2,7 +2,7 @@ from factory.django import DjangoModelFactory from app.content.factories import UserFactory -from app.index.models.bug import Bug +from app.feedback.models.bug import Bug class BugFactory(DjangoModelFactory): diff --git a/app/index/factories/idea_factory.py b/app/feedback/factories/idea_factory.py similarity index 87% rename from app/index/factories/idea_factory.py rename to app/feedback/factories/idea_factory.py index 643207704..c923c4710 100644 --- a/app/index/factories/idea_factory.py +++ b/app/feedback/factories/idea_factory.py @@ -2,7 +2,7 @@ from factory.django import DjangoModelFactory from app.content.factories import UserFactory -from app.index.models.idea import Idea +from app.feedback.models.idea import Idea class IdeaFactory(DjangoModelFactory): diff --git a/app/index/admin/__init__.py b/app/feedback/filters/__init__.py similarity index 100% rename from app/index/admin/__init__.py rename to app/feedback/filters/__init__.py diff --git a/app/index/migrations/0001_initial.py b/app/feedback/migrations/0001_initial.py similarity index 93% rename from app/index/migrations/0001_initial.py rename to app/feedback/migrations/0001_initial.py index fb78c0271..ff17edca6 100644 --- a/app/index/migrations/0001_initial.py +++ b/app/feedback/migrations/0001_initial.py @@ -1,4 +1,4 @@ -# Generated by Django 4.2.5 on 2024-09-26 14:54 +# Generated by Django 4.2.16 on 2024-10-11 15:33 from django.conf import settings from django.db import migrations, models @@ -80,14 +80,14 @@ class Migration(migrations.Migration): parent_link=True, primary_key=True, serialize=False, - to="index.feedback", + to="feedback.feedback", ), ), ], options={ "abstract": False, }, - bases=("index.feedback",), + bases=("feedback.feedback",), ), migrations.CreateModel( name="Idea", @@ -100,13 +100,13 @@ class Migration(migrations.Migration): parent_link=True, primary_key=True, serialize=False, - to="index.feedback", + to="feedback.feedback", ), ), ], options={ "abstract": False, }, - bases=("index.feedback",), + bases=("feedback.feedback",), ), ] diff --git a/app/index/filters/__init__.py b/app/feedback/migrations/__init__.py similarity index 100% rename from app/index/filters/__init__.py rename to app/feedback/migrations/__init__.py diff --git a/app/index/mixins.py b/app/feedback/mixins.py similarity index 100% rename from app/index/mixins.py rename to app/feedback/mixins.py diff --git a/app/feedback/models/__init__.py b/app/feedback/models/__init__.py new file mode 100644 index 000000000..604302afb --- /dev/null +++ b/app/feedback/models/__init__.py @@ -0,0 +1,3 @@ +from app.feedback.models.bug import Bug +from app.feedback.models.feedback import Feedback +from app.feedback.models.idea import Idea diff --git a/app/feedback/models/bug.py b/app/feedback/models/bug.py new file mode 100644 index 000000000..39962659d --- /dev/null +++ b/app/feedback/models/bug.py @@ -0,0 +1,5 @@ +from app.feedback.models.feedback import Feedback + + +class Bug(Feedback): + pass diff --git a/app/index/models/feedback.py b/app/feedback/models/feedback.py similarity index 98% rename from app/index/models/feedback.py rename to app/feedback/models/feedback.py index f91157c85..13d698db2 100644 --- a/app/index/models/feedback.py +++ b/app/feedback/models/feedback.py @@ -5,7 +5,7 @@ from app.common.enums import AdminGroup, Groups from app.common.permissions import BasePermissionModel, check_has_access from app.content.models.user import User -from app.index.enums import Status +from app.feedback.enums import Status from app.util.models import BaseModel diff --git a/app/feedback/models/idea.py b/app/feedback/models/idea.py new file mode 100644 index 000000000..42ecb6517 --- /dev/null +++ b/app/feedback/models/idea.py @@ -0,0 +1,5 @@ +from app.feedback.models.feedback import Feedback + + +class Idea(Feedback): + pass diff --git a/app/feedback/serializers/__init__.py b/app/feedback/serializers/__init__.py new file mode 100644 index 000000000..25f74a27d --- /dev/null +++ b/app/feedback/serializers/__init__.py @@ -0,0 +1,3 @@ +from app.feedback.serializers.bug import BugListSerializer +from app.feedback.serializers.idea import IdeaListSerializer +from app.feedback.serializers.feedback import FeedbackListPolymorphicSerializer diff --git a/app/index/serializers/bug.py b/app/feedback/serializers/bug.py similarity index 90% rename from app/index/serializers/bug.py rename to app/feedback/serializers/bug.py index 9d2ab12ab..850462566 100644 --- a/app/index/serializers/bug.py +++ b/app/feedback/serializers/bug.py @@ -1,6 +1,6 @@ from app.common.serializers import BaseModelSerializer from app.content.serializers.user import SimpleUserSerializer -from app.index.models.bug import Bug +from app.feedback.models.bug import Bug class BugListSerializer(BaseModelSerializer): diff --git a/app/index/serializers/feedback.py b/app/feedback/serializers/feedback.py similarity index 93% rename from app/index/serializers/feedback.py rename to app/feedback/serializers/feedback.py index df512adb7..588fc6800 100644 --- a/app/index/serializers/feedback.py +++ b/app/feedback/serializers/feedback.py @@ -1,8 +1,8 @@ from rest_polymorphic.serializers import PolymorphicSerializer from app.common.serializers import BaseModelSerializer -from app.index.models import Bug, Feedback, Idea -from app.index.serializers import BugListSerializer, IdeaListSerializer +from app.feedback.models import Bug, Feedback, Idea +from app.feedback.serializers import BugListSerializer, IdeaListSerializer class FeedbackListPolymorphicSerializer(PolymorphicSerializer, BaseModelSerializer): diff --git a/app/index/serializers/idea.py b/app/feedback/serializers/idea.py similarity index 90% rename from app/index/serializers/idea.py rename to app/feedback/serializers/idea.py index 344087f63..6b415eba1 100644 --- a/app/index/serializers/idea.py +++ b/app/feedback/serializers/idea.py @@ -1,6 +1,6 @@ from app.common.serializers import BaseModelSerializer from app.content.serializers.user import SimpleUserSerializer -from app.index.models.idea import Idea +from app.feedback.models.idea import Idea class IdeaListSerializer(BaseModelSerializer): diff --git a/app/index/migrations/__init__.py b/app/feedback/tasks/__init__.py similarity index 100% rename from app/index/migrations/__init__.py rename to app/feedback/tasks/__init__.py diff --git a/app/index/tasks/__init__.py b/app/feedback/tests/__init__.py similarity index 100% rename from app/index/tasks/__init__.py rename to app/feedback/tests/__init__.py diff --git a/app/index/urls.py b/app/feedback/urls.py similarity index 78% rename from app/index/urls.py rename to app/feedback/urls.py index 17a8202e3..c8922e8b3 100644 --- a/app/index/urls.py +++ b/app/feedback/urls.py @@ -1,7 +1,7 @@ from django.urls import include, re_path from rest_framework import routers -from app.index.views.feedback import FeedbackViewSet +from app.feedback.views.feedback import FeedbackViewSet router = routers.DefaultRouter() router.register("feedbacks", FeedbackViewSet) diff --git a/app/index/tests/__init__.py b/app/feedback/util/__init__.py similarity index 100% rename from app/index/tests/__init__.py rename to app/feedback/util/__init__.py diff --git a/app/index/util/__init__.py b/app/feedback/views/__init__.py similarity index 100% rename from app/index/util/__init__.py rename to app/feedback/views/__init__.py diff --git a/app/index/views/feedback.py b/app/feedback/views/feedback.py similarity index 96% rename from app/index/views/feedback.py rename to app/feedback/views/feedback.py index dcf5a2bdf..0ccbc653c 100644 --- a/app/index/views/feedback.py +++ b/app/feedback/views/feedback.py @@ -4,8 +4,8 @@ from app.common.pagination import BasePagination from app.common.permissions import BasicViewPermission from app.common.viewsets import BaseViewSet -from app.index.models.feedback import Feedback -from app.index.serializers.feedback import ( +from app.feedback.models.feedback import Feedback +from app.feedback.serializers.feedback import ( BugCreateSerializer, BugUpdateSerializer, FeedbackListPolymorphicSerializer, diff --git a/app/index/app.py b/app/index/app.py deleted file mode 100644 index fa3e063ef..000000000 --- a/app/index/app.py +++ /dev/null @@ -1,5 +0,0 @@ -from django.apps import AppConfig - - -class IndexConfig(AppConfig): - name = "app.index" diff --git a/app/index/factories/__init__.py b/app/index/factories/__init__.py deleted file mode 100644 index e4c63edf6..000000000 --- a/app/index/factories/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -from app.index.factories.bug_factory import BugFactory -from app.index.factories.idea_factory import IdeaFactory diff --git a/app/index/models/__init__.py b/app/index/models/__init__.py deleted file mode 100644 index 8f1a9108b..000000000 --- a/app/index/models/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -from app.index.models.bug import Bug -from app.index.models.feedback import Feedback -from app.index.models.idea import Idea diff --git a/app/index/models/bug.py b/app/index/models/bug.py deleted file mode 100644 index 2ba1c0b7b..000000000 --- a/app/index/models/bug.py +++ /dev/null @@ -1,5 +0,0 @@ -from app.index.models.feedback import Feedback - - -class Bug(Feedback): - pass diff --git a/app/index/models/idea.py b/app/index/models/idea.py deleted file mode 100644 index 1a504a7da..000000000 --- a/app/index/models/idea.py +++ /dev/null @@ -1,5 +0,0 @@ -from app.index.models.feedback import Feedback - - -class Idea(Feedback): - pass diff --git a/app/index/serializers/__init__.py b/app/index/serializers/__init__.py deleted file mode 100644 index 6c05e1f4f..000000000 --- a/app/index/serializers/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -from app.index.serializers.bug import BugListSerializer -from app.index.serializers.idea import IdeaListSerializer -from app.index.serializers.feedback import FeedbackListPolymorphicSerializer diff --git a/app/index/views/__init__.py b/app/index/views/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/app/settings.py b/app/settings.py index 90c264b6d..26e8c1fe4 100644 --- a/app/settings.py +++ b/app/settings.py @@ -106,7 +106,7 @@ "app.payment", "app.kontres", "app.emoji", - "app.index", + "app.feedback", "app.codex", ] diff --git a/app/tests/conftest.py b/app/tests/conftest.py index 1473ca03e..379619927 100644 --- a/app/tests/conftest.py +++ b/app/tests/conftest.py @@ -32,11 +32,11 @@ EventReactionFactory, NewsReactionFactory, ) +from app.feedback.factories import BugFactory, IdeaFactory from app.forms.tests.form_factories import FormFactory, SubmissionFactory from app.group.factories import GroupFactory, MembershipFactory from app.group.factories.fine_factory import FineFactory from app.group.factories.membership_factory import MembershipHistoryFactory -from app.index.factories import BugFactory, IdeaFactory from app.kontres.factories import BookableItemFactory, ReservationFactory from app.payment.factories.order_factory import OrderFactory from app.payment.factories.paid_event_factory import PaidEventFactory diff --git a/app/tests/index/test_feedback_integration.py b/app/tests/index/test_feedback_integration.py index 6535abc59..890c8ad45 100644 --- a/app/tests/index/test_feedback_integration.py +++ b/app/tests/index/test_feedback_integration.py @@ -4,7 +4,7 @@ from app.util.test_utils import get_api_client -FEEDBACK_BASE_URL = "/index/feedbacks/" +FEEDBACK_BASE_URL = "/feedbacks/" def get_data(type): diff --git a/app/urls.py b/app/urls.py index eabb182f5..301f23427 100644 --- a/app/urls.py +++ b/app/urls.py @@ -55,5 +55,5 @@ path("kontres/", include("app.kontres.urls")), path("emojis/", include("app.emoji.urls")), path("codex/", include("app.codex.urls")), - path("index/", include("app.index.urls")), + path("", include("app.feedback.urls")), ]