Skip to content

Commit

Permalink
Refactoring : renommer certaines views (#884)
Browse files Browse the repository at this point in the history
* Rename TenderDetailContactClickStat to TenderDetailContactClickStatView

* Rename SiaeUser views
  • Loading branch information
raphodn authored Aug 31, 2023
1 parent a5550d2 commit 20b2d55
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 13 deletions.
12 changes: 6 additions & 6 deletions lemarche/www/dashboard/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
SiaeEditSearchView,
SiaeSearchAdoptConfirmView,
SiaeSearchBySiretView,
SiaeUserDelete,
SiaeUserRequestCancel,
SiaeUserRequestConfirm,
SiaeUserDeleteView,
SiaeUserRequestCancelView,
SiaeUserRequestConfirmView,
SiaeUsersView,
)

Expand Down Expand Up @@ -72,17 +72,17 @@
),
path(
"prestataires/<str:slug>/collaborateurs/<str:siaeuserrequest_id>/accepter",
SiaeUserRequestConfirm.as_view(),
SiaeUserRequestConfirmView.as_view(),
name="siae_user_request_confirm",
),
path(
"prestataires/<str:slug>/collaborateurs/<str:siaeuserrequest_id>/refuser",
SiaeUserRequestCancel.as_view(),
SiaeUserRequestCancelView.as_view(),
name="siae_user_request_cancel",
),
path(
"prestataires/<str:slug>/collaborateurs/<str:siaeuser_id>/supprimer",
SiaeUserDelete.as_view(),
SiaeUserDeleteView.as_view(),
name="siae_user_delete",
),
# Redirects
Expand Down
6 changes: 3 additions & 3 deletions lemarche/www/dashboard/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ def get_success_url(self):
return reverse_lazy("dashboard:siae_edit_contact", args=[self.kwargs.get("slug")])


class SiaeUserRequestConfirm(SiaeMemberRequiredMixin, SuccessMessageMixin, UpdateView):
class SiaeUserRequestConfirmView(SiaeMemberRequiredMixin, SuccessMessageMixin, UpdateView):
form_class = SiaeUserRequestForm
template_name = "siaes/_siae_user_request_confirm_modal.html"
context_object_name = "siaeuserrequest"
Expand Down Expand Up @@ -366,7 +366,7 @@ def get_success_url(self):
return reverse_lazy("dashboard:siae_users", args=[self.kwargs.get("slug")])


class SiaeUserRequestCancel(SiaeMemberRequiredMixin, SuccessMessageMixin, UpdateView):
class SiaeUserRequestCancelView(SiaeMemberRequiredMixin, SuccessMessageMixin, UpdateView):
form_class = SiaeUserRequestForm
template_name = "siaes/_siae_user_request_cancel_modal.html"
context_object_name = "siaeuserrequest"
Expand All @@ -393,7 +393,7 @@ def get_success_url(self):
return reverse_lazy("dashboard:siae_users", args=[self.kwargs.get("slug")])


class SiaeUserDelete(SiaeMemberRequiredMixin, SuccessMessageMixin, DeleteView):
class SiaeUserDeleteView(SiaeMemberRequiredMixin, SuccessMessageMixin, DeleteView):
template_name = "siaes/_siae_user_delete_modal.html"
model = SiaeUser
# success_message = "L'utilisateur a été supprimé de votre structure."
Expand Down
2 changes: 1 addition & 1 deletion lemarche/www/tenders/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -800,7 +800,7 @@ def test_tender_contact_details_display(self):
self.assertContains(response, "Lien partagé")


class TenderDetailContactClickStatViewTest(TestCase):
class TenderDetailContactClickStatViewViewTest(TestCase):
@classmethod
def setUpTestData(cls):
cls.siae = SiaeFactory(name="ZZ ESI")
Expand Down
6 changes: 4 additions & 2 deletions lemarche/www/tenders/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from lemarche.www.tenders.views import (
TenderCreateMultiStepView,
TenderDetailContactClickStat,
TenderDetailContactClickStatView,
TenderDetailSurveyTransactionedView,
TenderDetailView,
TenderListView,
Expand All @@ -29,7 +29,9 @@
), # TODO: delete in 2024
path("<str:slug>/prestataires/statut/<status>", TenderSiaeListView.as_view(), name="detail-siae-list"),
path("<str:slug>/prestataires", TenderSiaeListView.as_view(), name="detail-siae-list"),
path("<str:slug>/contact-click-stat", TenderDetailContactClickStat.as_view(), name="detail-contact-click-stat"),
path(
"<str:slug>/contact-click-stat", TenderDetailContactClickStatView.as_view(), name="detail-contact-click-stat"
),
path(
"<str:slug>/sondage-transaction",
TenderDetailSurveyTransactionedView.as_view(),
Expand Down
2 changes: 1 addition & 1 deletion lemarche/www/tenders/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ def get_context_data(self, **kwargs):
return context


class TenderDetailContactClickStat(LoginRequiredMixin, UpdateView):
class TenderDetailContactClickStatView(LoginRequiredMixin, UpdateView):
"""
Endpoint to track contact_clicks by interested Siaes
We might also send a notification to the buyer
Expand Down

0 comments on commit 20b2d55

Please sign in to comment.