diff --git a/src/agenda_culturel/admin.py b/src/agenda_culturel/admin.py
index 9de4a23..8c5d32a 100644
--- a/src/agenda_culturel/admin.py
+++ b/src/agenda_culturel/admin.py
@@ -9,7 +9,7 @@ from .models import (
BatchImportation,
RecurrentImport,
Place,
- ContactMessage,
+ Message,
ReferenceLocation,
Organisation
)
@@ -25,7 +25,7 @@ admin.site.register(DuplicatedEvents)
admin.site.register(BatchImportation)
admin.site.register(RecurrentImport)
admin.site.register(Place)
-admin.site.register(ContactMessage)
+admin.site.register(Message)
admin.site.register(ReferenceLocation)
admin.site.register(Organisation)
diff --git a/src/agenda_culturel/filters.py b/src/agenda_culturel/filters.py
index a5d9d57..bb88335 100644
--- a/src/agenda_culturel/filters.py
+++ b/src/agenda_culturel/filters.py
@@ -44,7 +44,7 @@ from .models import (
Tag,
Event,
Category,
- ContactMessage,
+ Message,
DuplicatedEvents
)
@@ -361,7 +361,7 @@ class EventFilterAdmin(django_filters.FilterSet):
fields = ["status"]
-class ContactMessagesFilterAdmin(django_filters.FilterSet):
+class MessagesFilterAdmin(django_filters.FilterSet):
closed = django_filters.MultipleChoiceFilter(
label="Status",
choices=((True, _("Closed")), (False, _("Open"))),
@@ -374,7 +374,7 @@ class ContactMessagesFilterAdmin(django_filters.FilterSet):
)
class Meta:
- model = ContactMessage
+ model = Message
fields = ["closed", "spam"]
diff --git a/src/agenda_culturel/forms.py b/src/agenda_culturel/forms.py
index fc272db..4570aaf 100644
--- a/src/agenda_culturel/forms.py
+++ b/src/agenda_culturel/forms.py
@@ -24,7 +24,7 @@ from .models import (
Place,
Category,
Tag,
- ContactMessage
+ Message
)
from django.conf import settings
from django.core.files import File
@@ -783,10 +783,10 @@ class PlaceForm(GroupFormMixin, ModelForm):
def apply(self):
return self.cleaned_data.get("apply_to_all")
-class ContactMessageForm(ModelForm):
+class MessageForm(ModelForm):
class Meta:
- model = ContactMessage
+ model = Message
fields = ["subject", "name", "email", "message", "related_event"]
widgets = {"related_event": HiddenInput()}
diff --git a/src/agenda_culturel/migrations/0125_rename_contactmessage_message_alter_message_options.py b/src/agenda_culturel/migrations/0125_rename_contactmessage_message_alter_message_options.py
new file mode 100644
index 0000000..958fb15
--- /dev/null
+++ b/src/agenda_culturel/migrations/0125_rename_contactmessage_message_alter_message_options.py
@@ -0,0 +1,21 @@
+# Generated by Django 4.2.9 on 2024-12-11 11:33
+
+from django.db import migrations
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('agenda_culturel', '0124_place_postcode'),
+ ]
+
+ operations = [
+ migrations.RenameModel(
+ old_name='ContactMessage',
+ new_name='Message',
+ ),
+ migrations.AlterModelOptions(
+ name='message',
+ options={'verbose_name': 'Message', 'verbose_name_plural': 'Messages'},
+ ),
+ ]
diff --git a/src/agenda_culturel/models.py b/src/agenda_culturel/models.py
index 60bca41..b404527 100644
--- a/src/agenda_culturel/models.py
+++ b/src/agenda_culturel/models.py
@@ -1741,10 +1741,10 @@ class Event(models.Model):
return [Event.get_count_modification(w) for w in when_list]
-class ContactMessage(models.Model):
+class Message(models.Model):
class Meta:
- verbose_name = _("Contact message")
- verbose_name_plural = _("Contact messages")
+ verbose_name = _("Message")
+ verbose_name_plural = _("Messages")
subject = models.CharField(
verbose_name=_("Subject"),
@@ -1800,11 +1800,11 @@ class ContactMessage(models.Model):
null=True,
)
- def nb_open_contactmessages():
- return ContactMessage.objects.filter(closed=False).count()
+ def nb_open_messages():
+ return Message.objects.filter(closed=False).count()
def get_absolute_url(self):
- return reverse("contactmessage", kwargs={"pk": self.pk})
+ return reverse("message", kwargs={"pk": self.pk})
class RecurrentImport(models.Model):
diff --git a/src/agenda_culturel/templates/agenda_culturel/contactmessage_confirm_delete.html b/src/agenda_culturel/templates/agenda_culturel/message_confirm_delete.html
similarity index 100%
rename from src/agenda_culturel/templates/agenda_culturel/contactmessage_confirm_delete.html
rename to src/agenda_culturel/templates/agenda_culturel/message_confirm_delete.html
diff --git a/src/agenda_culturel/templates/agenda_culturel/contactmessage_create_form.html b/src/agenda_culturel/templates/agenda_culturel/message_create_form.html
similarity index 100%
rename from src/agenda_culturel/templates/agenda_culturel/contactmessage_create_form.html
rename to src/agenda_culturel/templates/agenda_culturel/message_create_form.html
diff --git a/src/agenda_culturel/templates/agenda_culturel/contactmessage_moderation_form.html b/src/agenda_culturel/templates/agenda_culturel/message_moderation_form.html
similarity index 88%
rename from src/agenda_culturel/templates/agenda_culturel/contactmessage_moderation_form.html
rename to src/agenda_culturel/templates/agenda_culturel/message_moderation_form.html
index 52bc8fe..6e2d656 100644
--- a/src/agenda_culturel/templates/agenda_culturel/contactmessage_moderation_form.html
+++ b/src/agenda_culturel/templates/agenda_culturel/message_moderation_form.html
@@ -24,7 +24,7 @@
Modération du message « {{ object.subject }} »
@@ -47,7 +47,7 @@