diff --git a/src/agenda_culturel/locale/fr/LC_MESSAGES/django.po b/src/agenda_culturel/locale/fr/LC_MESSAGES/django.po index 512c255..39ed308 100644 --- a/src/agenda_culturel/locale/fr/LC_MESSAGES/django.po +++ b/src/agenda_culturel/locale/fr/LC_MESSAGES/django.po @@ -250,4 +250,7 @@ msgid "The end time cannot be earlier than the start time." msgstr "L'heure de fin ne peut pas être avant l'heure de début." msgid "The event has been submitted and will be published as soon as it has been validated by the moderation team." -msgstr "L'événement a été soumis et sera publié dès qu'il aura été validé par l'équipe de modération." \ No newline at end of file +msgstr "L'événement a été soumis et sera publié dès qu'il aura été validé par l'équipe de modération." + +msgid "The URL has been taken into account, and the associated event will be available in a few moments for validation." +msgstr "L'URL a été prise en compte, et l'événement associé sera disponible dans quelques instants pour validation." \ No newline at end of file diff --git a/src/agenda_culturel/views.py b/src/agenda_culturel/views.py index 610c9f5..4c5a579 100644 --- a/src/agenda_culturel/views.py +++ b/src/agenda_culturel/views.py @@ -388,7 +388,6 @@ class EventDetailView(UserPassesTestMixin, DetailView): class EventSubmissionFormView(FormView): form_class = EventSubmissionModelForm template_name = "agenda_culturel/import.html" - success_url = "/" def form_valid(self, form): form.save() @@ -398,10 +397,18 @@ class EventSubmissionFormView(FormView): def create_event(self, valid_data): url = valid_data["url"] - messages.success(self.request, _("The URL has been submitted and the associated event will be integrated in the agenda after validation.")) + if self.request.user.is_authenticated: + messages.success(self.request, _("The URL has been taken into account, and the associated event will be available in a few moments for validation.")) + else: + messages.success(self.request, _("The URL has been submitted and the associated event will be integrated in the agenda after validation.")) create_event_from_submission.delay(url) + def get_success_url(self, **kwargs): + if self.request.user.is_authenticated: + return reverse_lazy("view_all_events") + else: + return reverse_lazy("home") class EventFilterAdmin(django_filters.FilterSet):