Skip to content

Commit

Permalink
Rename project folder to "config"
Browse files Browse the repository at this point in the history
This is to prepare for a single app named "tilavarauspalvelu"
  • Loading branch information
matti-lamppu committed Sep 18, 2024
1 parent ec0cf05 commit 832e663
Show file tree
Hide file tree
Showing 52 changed files with 75 additions and 75 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ jobs:
DATABASE_URL: postgis://tvp:tvp@localhost:5432/tvp

- name: "Test for missing translation"
run: poetry run python -m tilavarauspalvelu.hooks.translations_done
run: poetry run python -m config.hooks.translations_done
env:
DJANGO_SETTINGS_ENVIRONMENT: CI
DATABASE_URL: postgis://tvp:tvp@localhost:5432/tvp
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ stop:
@docker compose stop

check-translations:
@python -m tilavarauspalvelu.hooks.translations_done
@python -m config.hooks.translations_done

translations:
@echo ""
Expand Down
2 changes: 1 addition & 1 deletion api/helauth/urls.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This file exists so that we can use a custom `TunnistamoOIDCAuth` backend.
# See `tilavarauspalvelu.auth.ProxyTunnistamoOIDCAuthBackend` for more details.
# See `config.auth.ProxyTunnistamoOIDCAuthBackend` for more details.
# Using `helusers/urls.py` will not add the URLs to the file's `urlpatterns` unless
# `helusers.tunnistamo_oidc.TunnistamoOIDCAuth` is specifically included in the
# `AUTHENTICATION_BACKENDS` setting.
Expand Down
2 changes: 1 addition & 1 deletion applications/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
from applications.models import Address, AllocatedTimeSlot, Organisation, Person
from common.date_utils import local_end_of_day, local_start_of_day
from common.utils import translate_for_user
from config.celery import app
from opening_hours.enums import HaukiResourceState
from opening_hours.utils.hauki_api_client import HaukiAPIClient
from opening_hours.utils.time_span_element import TimeSpanElement
from reservations.enums import CustomerTypeChoice, ReservationStateChoice, ReservationTypeChoice
from reservations.models import RecurringReservation
from reservations.tasks import create_or_update_reservation_statistics, update_affecting_time_spans_task
from tilavarauspalvelu.celery import app
from utils.sentry import SentryLogger


Expand Down
2 changes: 1 addition & 1 deletion common/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from common.models import RequestLog, SQLLog
from common.typing import QueryInfo
from tilavarauspalvelu.celery import app
from config.celery import app
from utils.sentry import SentryLogger

__all__ = [
Expand Down
2 changes: 1 addition & 1 deletion tilavarauspalvelu/__init__.py → config/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This will make sure the app is always imported when
# Django starts so that shared_task will use this app.
from tilavarauspalvelu.celery import app as celery_app
from config.celery import app as celery_app

__all__ = ("celery_app",)
File renamed without changes.
2 changes: 1 addition & 1 deletion tilavarauspalvelu/celery.py → config/celery.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from kombu.asynchronous.timer import Entry, Timer

# Set the default Django settings module for the 'celery' app.
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "tilavarauspalvelu.settings")
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings")


class LivenessProbe(bootsteps.StartStopStep):
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class MissingTranslations:


def main() -> int:
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "tilavarauspalvelu.settings")
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings")
django.setup()

items = _get_current_translations()
Expand Down
File renamed without changes.
File renamed without changes.
20 changes: 10 additions & 10 deletions tilavarauspalvelu/settings.py → config/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ class Common(Environment):

# --- Basic settings ---------------------------------------------------------------------------------------------

WSGI_APPLICATION = "tilavarauspalvelu.wsgi.application"
ROOT_URLCONF = "tilavarauspalvelu.urls"
WSGI_APPLICATION = "config.wsgi.application"
ROOT_URLCONF = "config.urls"
AUTH_USER_MODEL = "users.User"
DEFAULT_AUTO_FIELD = "django.db.models.AutoField"
SECRET_KEY = values.StringValue()
Expand Down Expand Up @@ -97,8 +97,8 @@ class Common(Environment):
]

MIDDLEWARE = [
"tilavarauspalvelu.middleware.QueryLoggingMiddleware",
"tilavarauspalvelu.middleware.MultipleProxyMiddleware",
"config.middleware.QueryLoggingMiddleware",
"config.middleware.MultipleProxyMiddleware",
"corsheaders.middleware.CorsMiddleware",
"django.middleware.security.SecurityMiddleware",
# Keep this after security middleware, correct place according to whitenoise documentation
Expand Down Expand Up @@ -230,7 +230,7 @@ def LOGGING(cls):
"filters": {},
"formatters": {
"common": {
"()": "tilavarauspalvelu.logging.TVPFormatter",
"()": "config.logging.TVPFormatter",
"format": (
"Time: {asctime} "
"| Level: {levelname} "
Expand Down Expand Up @@ -285,8 +285,8 @@ def LOGGING(cls):
# --- Authentication settings ------------------------------------------------------------------------------------

AUTHENTICATION_BACKENDS = [
"tilavarauspalvelu.auth.ProxyTunnistamoOIDCAuthBackend",
"tilavarauspalvelu.auth.ProxyModelBackend",
"config.auth.ProxyTunnistamoOIDCAuthBackend",
"config.auth.ProxyModelBackend",
]

AUTH_PASSWORD_VALIDATORS = [
Expand Down Expand Up @@ -398,7 +398,7 @@ def SOCIAL_AUTH_TUNNISTAMO_SCOPE(cls):
GRAPHENE = {
"SCHEMA": "api.graphql.schema.schema",
"MIDDLEWARE": [
"tilavarauspalvelu.middleware.GraphQLSentryMiddleware",
"config.middleware.GraphQLSentryMiddleware",
],
}

Expand Down Expand Up @@ -634,7 +634,7 @@ class Local(Common, overrides_from=LocalMixin):
"SCHEMA": Common.GRAPHENE["SCHEMA"],
"MIDDLEWARE": [
"graphene_django.debug.DjangoDebugMiddleware",
"tilavarauspalvelu.middleware.GraphQLErrorLoggingMiddleware",
"config.middleware.GraphQLErrorLoggingMiddleware",
],
}

Expand Down Expand Up @@ -755,7 +755,7 @@ class AutomatedTests(EmptyDefaults, Common, dotenv_path=None, overrides_from=Aut
"SCHEMA": Common.GRAPHENE["SCHEMA"],
"TESTING_ENDPOINT": "/graphql/",
"MIDDLEWARE": [
"tilavarauspalvelu.middleware.GraphQLErrorLoggingMiddleware",
"config.middleware.GraphQLErrorLoggingMiddleware",
],
}

Expand Down
2 changes: 1 addition & 1 deletion tilavarauspalvelu/urls.py → config/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
admin.site.each_context = lambda request: original_each_context(request) | {
"version": settings.APP_VERSION,
# The helauth variables need to be added, since we subclass `helusers.tunnistamo_oidc.TunnistamoOIDCAuth`
# with `tilavarauspalvelu.auth.ProxyTunnistamoOIDCAuthBackend` for optimizing request user fetching.
# with `config.auth.ProxyTunnistamoOIDCAuthBackend` for optimizing request user fetching.
# `helusers.admin_site.AdminSite.each_context` refers to the original backend by
# string reference, so subclasses won't have the login/logout urls added.
"helsinki_provider_installed": True,
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion tilavarauspalvelu/wsgi.py → config/wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

from django.core.wsgi import get_wsgi_application

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "tilavarauspalvelu.settings")
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings")

application = get_wsgi_application()
4 changes: 2 additions & 2 deletions docker/uwsgi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ uwsgi:
# Needed plugins if running against Debian uwsgi-package
# python docker image cannot use that due to linker mishaps
# plugins: python3,http
module: tilavarauspalvelu.wsgi:application
# wsgi-file: tilavarauspalvelu/wsgi.p
module: config.wsgi:application
# wsgi-file: config/wsgi.p
#uid: tvp
umask: 022
http: :8000
Expand Down
2 changes: 1 addition & 1 deletion elastic_django/reservation_units/tasks.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from django.conf import settings
from elasticsearch_django.index import create_index, delete_index, update_index

from tilavarauspalvelu.celery import app
from config.celery import app


@app.task(name="Update ReservationUnit Elastic index")
Expand Down
2 changes: 1 addition & 1 deletion email_notification/admin/email_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
from django.template.response import TemplateResponse
from modeltranslation.admin import TranslationAdmin

from config.utils.commons import LanguageType
from email_notification.admin.email_template_tester import email_template_tester_admin_view
from email_notification.exceptions import EmailTemplateValidationError
from email_notification.helpers.email_builder_application import ApplicationEmailBuilder, ApplicationEmailContext
from email_notification.helpers.email_builder_reservation import ReservationEmailBuilder, ReservationEmailContext
from email_notification.helpers.email_validator import EmailTemplateValidator
from email_notification.models import EmailTemplate, EmailType
from tilavarauspalvelu.utils.commons import LanguageType

__all__ = [
"EmailTemplateAdmin",
Expand Down
2 changes: 1 addition & 1 deletion email_notification/helpers/email_builder_application.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

if TYPE_CHECKING:
from applications.models import Application
from tilavarauspalvelu.utils.commons import LanguageType
from config.utils.commons import LanguageType


@dataclass
Expand Down
2 changes: 1 addition & 1 deletion email_notification/helpers/email_builder_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
if TYPE_CHECKING:
from django.db.models.fields.files import FieldFile

from config.utils.commons import LanguageType
from email_notification.models import EmailTemplate, EmailType
from tilavarauspalvelu.utils.commons import LanguageType


@dataclass
Expand Down
2 changes: 1 addition & 1 deletion email_notification/helpers/email_builder_reservation.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
from reservations.enums import CustomerTypeChoice

if TYPE_CHECKING:
from config.utils.commons import LanguageType
from email_notification.admin.email_template_tester import EmailTemplateTesterForm
from reservations.models import Reservation
from spaces.models import Location
from tilavarauspalvelu.utils.commons import LanguageType

type InstructionNameType = Literal["confirmed", "pending", "cancelled"]

Expand Down
2 changes: 1 addition & 1 deletion email_notification/helpers/email_sender.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
from collections.abc import Iterable

from applications.models import Application
from config.utils.commons import LanguageType
from email_notification.admin.email_template_tester import EmailTemplateTesterForm
from email_notification.helpers.email_builder_base import BaseEmailBuilder
from reservations.models import Reservation
from tilavarauspalvelu.utils.commons import LanguageType


class EmailNotificationSender:
Expand Down
2 changes: 1 addition & 1 deletion email_notification/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
from applications.enums import ApplicationRoundStatusChoice, ApplicationSectionStatusChoice
from applications.models import Application
from common.date_utils import local_datetime
from config.celery import app
from email_notification.exceptions import SendEmailNotificationError
from email_notification.helpers.email_sender import EmailNotificationSender
from email_notification.models import EmailType
from reservations.models import Reservation
from spaces.models import Unit
from tilavarauspalvelu.celery import app
from users.models import ReservationNotification, User
from utils.sentry import SentryLogger

Expand Down
20 changes: 10 additions & 10 deletions locale/fi/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -846,31 +846,31 @@ msgstr "Etsi etu- tai sukunimellä."
msgid "Seasonal Booking"
msgstr "Kausivaraus"

#: applications/enums.py tilavarauspalvelu/utils/commons.py
#: applications/enums.py config/utils/commons.py
msgid "Monday"
msgstr "Maanantai"

#: applications/enums.py tilavarauspalvelu/utils/commons.py
#: applications/enums.py config/utils/commons.py
msgid "Tuesday"
msgstr "Tiistai"

#: applications/enums.py tilavarauspalvelu/utils/commons.py
#: applications/enums.py config/utils/commons.py
msgid "Wednesday"
msgstr "Keskiviikko"

#: applications/enums.py tilavarauspalvelu/utils/commons.py
#: applications/enums.py config/utils/commons.py
msgid "Thursday"
msgstr "Torstai"

#: applications/enums.py tilavarauspalvelu/utils/commons.py
#: applications/enums.py config/utils/commons.py
msgid "Friday"
msgstr "Perjantai"

#: applications/enums.py tilavarauspalvelu/utils/commons.py
#: applications/enums.py config/utils/commons.py
msgid "Saturday"
msgstr "Lauantai"

#: applications/enums.py tilavarauspalvelu/utils/commons.py
#: applications/enums.py config/utils/commons.py
msgid "Sunday"
msgstr "Sunnuntai"

Expand Down Expand Up @@ -1528,15 +1528,15 @@ msgstr ""
"Etsi maksutunnuksella, varauksen tunnuksella, verkkokaupan tunnuksella, "
"varauksen nimellä tai varausyksikön nimellä"

#: merchants/enums.py tilavarauspalvelu/settings.py
#: merchants/enums.py config/settings.py
msgid "Finnish"
msgstr "Suomi"

#: merchants/enums.py tilavarauspalvelu/settings.py
#: merchants/enums.py config/settings.py
msgid "Swedish"
msgstr "Ruotsi"

#: merchants/enums.py tilavarauspalvelu/settings.py
#: merchants/enums.py config/settings.py
msgid "English"
msgstr "Englanti"

Expand Down
20 changes: 10 additions & 10 deletions locale/sv/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -817,31 +817,31 @@ msgstr ""
msgid "Seasonal Booking"
msgstr ""

#: applications/enums.py tilavarauspalvelu/utils/commons.py
#: applications/enums.py config/utils/commons.py
msgid "Monday"
msgstr ""

#: applications/enums.py tilavarauspalvelu/utils/commons.py
#: applications/enums.py config/utils/commons.py
msgid "Tuesday"
msgstr ""

#: applications/enums.py tilavarauspalvelu/utils/commons.py
#: applications/enums.py config/utils/commons.py
msgid "Wednesday"
msgstr ""

#: applications/enums.py tilavarauspalvelu/utils/commons.py
#: applications/enums.py config/utils/commons.py
msgid "Thursday"
msgstr ""

#: applications/enums.py tilavarauspalvelu/utils/commons.py
#: applications/enums.py config/utils/commons.py
msgid "Friday"
msgstr ""

#: applications/enums.py tilavarauspalvelu/utils/commons.py
#: applications/enums.py config/utils/commons.py
msgid "Saturday"
msgstr ""

#: applications/enums.py tilavarauspalvelu/utils/commons.py
#: applications/enums.py config/utils/commons.py
msgid "Sunday"
msgstr ""

Expand Down Expand Up @@ -1480,15 +1480,15 @@ msgid ""
"name, or Reservation Unit name"
msgstr ""

#: merchants/enums.py tilavarauspalvelu/settings.py
#: merchants/enums.py config/settings.py
msgid "Finnish"
msgstr ""

#: merchants/enums.py tilavarauspalvelu/settings.py
#: merchants/enums.py config/settings.py
msgid "Swedish"
msgstr ""

#: merchants/enums.py tilavarauspalvelu/settings.py
#: merchants/enums.py config/settings.py
msgid "English"
msgstr ""

Expand Down
2 changes: 1 addition & 1 deletion manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
from django.core.management import execute_from_command_line

if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "tilavarauspalvelu.settings")
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings")

execute_from_command_line(sys.argv)
2 changes: 1 addition & 1 deletion merchants/verkkokauppa/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from django.utils.timezone import get_default_timezone

from common.date_utils import local_datetime
from config.utils.date_util import localized_short_weekday
from merchants.models import PaymentMerchant, PaymentProduct
from merchants.verkkokauppa.exceptions import UnsupportedMetaKeyError
from merchants.verkkokauppa.order.types import (
Expand All @@ -18,7 +19,6 @@
)
from reservation_units.utils.reservation_unit_payment_helper import ReservationUnitPaymentHelper
from reservations.models import Reservation
from tilavarauspalvelu.utils.date_util import localized_short_weekday


def parse_datetime(string: str | None) -> datetime | None:
Expand Down
Loading

0 comments on commit 832e663

Please sign in to comment.