diff --git a/contrib/views/common/form_tabs/coordonnees.py b/contrib/views/common/form_tabs/coordonnees.py index 1aca24fd..4dc4c7a9 100644 --- a/contrib/views/common/form_tabs/coordonnees.py +++ b/contrib/views/common/form_tabs/coordonnees.py @@ -6,7 +6,7 @@ # The core business involves the administration of students, teachers, # courses, programs and so on. # -# Copyright (C) 2015-2023 Université catholique de Louvain (http://www.uclouvain.be) +# Copyright (C) 2015-2024 Université catholique de Louvain (http://www.uclouvain.be) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -23,7 +23,6 @@ # see http://www.gnu.org/licenses/. # # ############################################################################## -from django.shortcuts import render from django.utils.functional import cached_property from django.views.generic import FormView @@ -36,12 +35,10 @@ ContinuingEducationAdmissionPersonService, GeneralEducationAdmissionPersonService, ) +from admission.services.proposition import PostalCodeBusinessException __all__ = ['AdmissionCoordonneesFormView'] -from admission.services.proposition import PostalCodeBusinessException, AdmissionPropositionService -from admission.templatetags.admission import can_make_action - class AdmissionCoordonneesFormView(LoadDossierViewMixin, WebServiceFormMixin, FormView): template_name = 'admission/forms/coordonnees.html' @@ -65,21 +62,6 @@ def __init__(self, *args, **kwargs): self._error_mapping_residential = {exc.value: field for exc, field in self.error_mapping_residential.items()} super().__init__(*args, **kwargs) - def get(self, request, *args, **kwargs): - # In case of a creation and if we don't have permission to update the coordinates, - # we show the read-only template - if not self.admission_uuid: - permissions = AdmissionPropositionService.list_proposition_create_permissions(request.user.person) - if not can_make_action(permissions, 'create_coordinates'): - coordonnees = self.coordonnees - context = super().get_context_data( - with_submit=False, - coordonnees=coordonnees, - show_contact=coordonnees['contact'] is not None, - ) - return render(request, 'admission/details/coordonnees.html', context) - return super().get(request, *args, **kwargs) - def get_context_data(self, **kwargs): context_data = super().get_context_data(**kwargs) context_data.update(self.get_forms()) diff --git a/locale/en/LC_MESSAGES/django.po b/locale/en/LC_MESSAGES/django.po index 801526eb..6d9f9db1 100644 --- a/locale/en/LC_MESSAGES/django.po +++ b/locale/en/LC_MESSAGES/django.po @@ -546,12 +546,6 @@ msgstr "" msgid "Bank account" msgstr "" -#, python-format -msgid "" -"Because you already submitted an admission, information about coordinates " -"can not be updated. If you want to update them, please contact %(recipient)s." -msgstr "" - #, python-format msgid "" "Because you already submitted an admission, information about identification " diff --git a/locale/fr_BE/LC_MESSAGES/django.po b/locale/fr_BE/LC_MESSAGES/django.po index 242eef8c..b9232fa1 100644 --- a/locale/fr_BE/LC_MESSAGES/django.po +++ b/locale/fr_BE/LC_MESSAGES/django.po @@ -640,15 +640,6 @@ msgstr "Revenir à la page" msgid "Bank account" msgstr "Compte bancaire" -#, python-format -msgid "" -"Because you already submitted an admission, information about coordinates " -"can not be updated. If you want to update them, please contact %(recipient)s." -msgstr "" -"Etant donné que vous avez envoyé une autre demande d'inscription, les " -"informations des coordonnées ne peuvent être modifiées. Si vous souhaitez y " -"apporter des modifications, merci de contacter %(recipient)s." - #, python-format msgid "" "Because you already submitted an admission, information about identification " diff --git a/templates/admission/details/coordonnees.html b/templates/admission/details/coordonnees.html index 864b416a..3238a9f4 100644 --- a/templates/admission/details/coordonnees.html +++ b/templates/admission/details/coordonnees.html @@ -26,14 +26,6 @@ {% endcomment %} {% block tab_content %} - {% if not admission|can_update_tab:"coordonnees" %} -
- {% blocktrans trimmed with recipient=training_contact|default:_('the enrolment office') %} - Because you already submitted an admission, information about coordinates can not be updated. - If you want to update them, please contact {{ recipient }}. - {% endblocktrans %} -
- {% endif %} {% panel _("Legal domicile") %}
{% field_data _("Street") coordonnees.residential.street %}
@@ -76,18 +68,4 @@ {% field_data _('Emergency contact (telephone number)') coordonnees.emergency_contact_phone "col-md-6" %}
{% endpanel %} - - {% if not admission|can_update_tab:"coordonnees" %} - - - {% trans "Continue" %} - - {% endif %} {% endblock %} diff --git a/tests/views/test_coordonnees.py b/tests/views/test_coordonnees.py index 44fa1c78..6af408c7 100644 --- a/tests/views/test_coordonnees.py +++ b/tests/views/test_coordonnees.py @@ -102,7 +102,7 @@ def get_countries(**kwargs): self.mock_academic_year_api = academic_year_api_patcher.start() self.addCleanup(academic_year_api_patcher.stop) - def test_form_with_submitted_admission_is_readonly(self): + def test_form_with_submitted_admission_is_not_readonly(self): url = resolve_url('admission:create:coordonnees') self.client.force_login(self.person.user) @@ -114,8 +114,8 @@ def test_form_with_submitted_admission_is_readonly(self): response = self.client.get(url) self.assertEqual(response.status_code, 200) - self.assertTemplateNotUsed(response, 'admission/forms/coordonnees.html') - self.assertTemplateUsed(response, 'admission/details/coordonnees.html') + self.assertTemplateNotUsed(response, 'admission/details/coordonnees.html') + self.assertTemplateUsed(response, 'admission/forms/coordonnees.html') def test_form_display(self): url = resolve_url('admission:create:coordonnees')