From ca11dc5db88962ef72d792aa5fcd23f4277ebb77 Mon Sep 17 00:00:00 2001 From: Xavier Fernandez Date: Wed, 11 Dec 2024 11:43:37 +0100 Subject: [PATCH] Remove now useless @login_required decorators --- itou/www/apply/views/edit_views.py | 3 -- itou/www/apply/views/list_views.py | 8 ---- itou/www/apply/views/process_views.py | 15 ------ itou/www/apply/views/submit_views.py | 5 -- itou/www/approvals_views/views.py | 10 ---- itou/www/autocomplete/views.py | 3 +- itou/www/companies_views/views.py | 17 +------ itou/www/dashboard/views.py | 11 +---- itou/www/employee_record_views/views.py | 10 ---- itou/www/geiq_views/views.py | 8 ---- itou/www/gps/views.py | 5 -- itou/www/institutions_views/views.py | 4 -- itou/www/invitations_views/views.py | 8 +--- itou/www/itou_staff_views/views.py | 6 --- itou/www/prescribers_views/views.py | 7 +-- itou/www/siae_evaluations_views/views.py | 15 +----- itou/www/signup/views.py | 3 +- itou/www/stats/views.py | 61 +----------------------- itou/www/welcoming_tour/views.py | 2 - 19 files changed, 8 insertions(+), 193 deletions(-) diff --git a/itou/www/apply/views/edit_views.py b/itou/www/apply/views/edit_views.py index c5bf8eb007..3a098c0b9e 100644 --- a/itou/www/apply/views/edit_views.py +++ b/itou/www/apply/views/edit_views.py @@ -1,5 +1,4 @@ from django.contrib import messages -from django.contrib.auth.decorators import login_required from django.core.exceptions import PermissionDenied from django.http import Http404, HttpResponseRedirect from django.shortcuts import get_object_or_404, render @@ -12,7 +11,6 @@ from itou.www.apply.forms import EditHiringDateForm -@login_required def edit_contract_start_date(request, job_application_id, template_name="apply/edit_contract_start_date.html"): """ Update contract start date: @@ -51,7 +49,6 @@ def edit_contract_start_date(request, job_application_id, template_name="apply/e return render(request, template_name, context) -@login_required @require_POST def archive_view(request, job_application_id, *, action): extra_filters = {} diff --git a/itou/www/apply/views/list_views.py b/itou/www/apply/views/list_views.py index 7390548702..393dc93340 100644 --- a/itou/www/apply/views/list_views.py +++ b/itou/www/apply/views/list_views.py @@ -2,7 +2,6 @@ from collections import defaultdict from django.conf import settings -from django.contrib.auth.decorators import login_required from django.db import models from django.db.models import Count, Exists, F, OuterRef, Q, Subquery from django.shortcuts import render @@ -102,7 +101,6 @@ def _add_administrative_criteria(job_applications): job_application.preloaded_administrative_criteria_extra_nb = extra_nb -@login_required @check_user(lambda u: u.is_job_seeker) def list_for_job_seeker(request, template_name="apply/list_for_job_seeker.html"): """ @@ -179,7 +177,6 @@ def annotate_title(base_title, archived_choice): raise ValueError(archived_choice) -@login_required @check_user(lambda u: u.is_prescriber or u.is_employer) def list_prescriptions(request, template_name="apply/list_prescriptions.html"): """ @@ -227,7 +224,6 @@ def list_prescriptions(request, template_name="apply/list_prescriptions.html"): ) -@login_required @check_user(lambda u: u.is_prescriber or u.is_employer) def list_prescriptions_exports(request, template_name="apply/list_of_available_exports.html"): """ @@ -248,7 +244,6 @@ def list_prescriptions_exports(request, template_name="apply/list_of_available_e return render(request, template_name, context) -@login_required @check_user(lambda u: u.is_prescriber or u.is_employer) def list_prescriptions_exports_download(request, month_identifier=None): """ @@ -267,7 +262,6 @@ def list_prescriptions_exports_download(request, month_identifier=None): return stream_xlsx_export(job_applications, filename, request_user=request.user) -@login_required def list_for_siae(request, template_name="apply/list_for_siae.html"): """ List of applications for an SIAE. @@ -356,7 +350,6 @@ def list_for_siae(request, template_name="apply/list_for_siae.html"): ) -@login_required def list_for_siae_exports(request, template_name="apply/list_of_available_exports.html"): """ List of applications for a SIAE, sorted by month, displaying the count of applications per month @@ -378,7 +371,6 @@ def list_for_siae_exports(request, template_name="apply/list_of_available_export return render(request, template_name, context) -@login_required def list_for_siae_exports_download(request, month_identifier=None): """ List of applications for a SIAE for a given month identifier (YYYY-mm), diff --git a/itou/www/apply/views/process_views.py b/itou/www/apply/views/process_views.py index 1aef7f4669..e739fb73fc 100644 --- a/itou/www/apply/views/process_views.py +++ b/itou/www/apply/views/process_views.py @@ -6,7 +6,6 @@ import sentry_sdk from django.conf import settings from django.contrib import messages -from django.contrib.auth.decorators import login_required from django.contrib.auth.mixins import LoginRequiredMixin from django.core.exceptions import PermissionDenied from django.db import transaction @@ -82,7 +81,6 @@ def _get_geiq_eligibility_diagnosis(job_application, only_prescriber): ).first() -@login_required def details_for_jobseeker(request, job_application_id, template_name="apply/process_details.html"): """ Detail of an application for a JOBSEEKER @@ -160,7 +158,6 @@ def details_for_jobseeker(request, job_application_id, template_name="apply/proc return render(request, template_name, context) -@login_required def details_for_company(request, job_application_id, template_name="apply/process_details_company.html"): """ Detail of an application for an SIAE with the ability: @@ -273,7 +270,6 @@ def details_for_company(request, job_application_id, template_name="apply/proces return render(request, template_name, context) -@login_required @check_user(lambda u: u.is_prescriber or u.is_employer) def details_for_prescriber(request, job_application_id, template_name="apply/process_details.html"): """ @@ -355,7 +351,6 @@ def details_for_prescriber(request, job_application_id, template_name="apply/pro return render(request, template_name, context) -@login_required @require_POST def process(request, job_application_id): queryset = JobApplication.objects.is_active_company_member(request.user) @@ -496,7 +491,6 @@ def get_step_url(self, step): return reverse(f"apply:{self.url_name}", kwargs={"job_application_id": self.job_application.pk, "step": step}) -@login_required def postpone(request, job_application_id, template_name="apply/process_postpone.html"): queryset = JobApplication.objects.is_active_company_member(request.user) job_application = get_object_or_404(queryset, id=job_application_id) @@ -529,7 +523,6 @@ def postpone(request, job_application_id, template_name="apply/process_postpone. return render(request, template_name, context) -@login_required def accept(request, job_application_id, template_name="apply/process_accept.html"): """ Trigger the `accept` transition. @@ -595,7 +588,6 @@ class ReloadJobDescriptionFields(AcceptHTMXFragmentView): NO_ERROR_FIELDS = ("appellation", "location") -@login_required @require_POST def cancel(request, job_application_id): """ @@ -619,7 +611,6 @@ def cancel(request, job_application_id): return HttpResponseRedirect(next_url) -@login_required def transfer(request, job_application_id): queryset = JobApplication.objects.is_active_company_member(request.user) job_application = get_object_or_404(queryset, pk=job_application_id) @@ -879,7 +870,6 @@ def get_context_data(self, **kwargs): } -@login_required @require_POST def send_diagoriente_invite(request, job_application_id): """ @@ -900,7 +890,6 @@ def send_diagoriente_invite(request, job_application_id): return HttpResponseRedirect(redirect_url) -@login_required def eligibility(request, job_application_id, template_name="apply/process_eligibility.html"): """ Check eligibility (as an SIAE). @@ -923,7 +912,6 @@ def eligibility(request, job_application_id, template_name="apply/process_eligib ) -@login_required def geiq_eligibility(request, job_application_id, template_name="apply/process_geiq_eligibility.html"): queryset = JobApplication.objects.is_active_company_member(request.user) # Check GEIQ eligibility during job application process @@ -946,7 +934,6 @@ def geiq_eligibility(request, job_application_id, template_name="apply/process_g ) -@login_required def geiq_eligibility_criteria( request, job_application_id, @@ -999,7 +986,6 @@ def delete_prior_action(request, job_application_id, prior_action_id): return HttpResponse(content) -@login_required def add_or_modify_prior_action(request, job_application_id, prior_action_id=None): queryset = JobApplication.objects.is_active_company_member(request.user) job_application = get_object_or_404( @@ -1099,7 +1085,6 @@ def add_or_modify_prior_action(request, job_application_id, prior_action_id=None return render(request, "apply/includes/job_application_prior_action_form.html", context) -@login_required @require_POST def rdv_insertion_invite(request, job_application_id, for_detail=False): if not request.user.is_employer: diff --git a/itou/www/apply/views/submit_views.py b/itou/www/apply/views/submit_views.py index c959e9d3bd..d23a422795 100644 --- a/itou/www/apply/views/submit_views.py +++ b/itou/www/apply/views/submit_views.py @@ -2,7 +2,6 @@ import uuid from dateutil.relativedelta import relativedelta -from django.contrib.auth.decorators import login_required from django.core.exceptions import PermissionDenied from django.core.files.storage import storages from django.forms import ValidationError @@ -782,7 +781,6 @@ def get_context_data(self, **kwargs): } -@login_required def eligibility_for_hire( request, company_pk, @@ -817,7 +815,6 @@ def eligibility_for_hire( ) -@login_required def geiq_eligibility_for_hire( request, company_pk, @@ -854,7 +851,6 @@ def geiq_eligibility_for_hire( ) -@login_required def geiq_eligibility_criteria_for_hire(request, company_pk, job_seeker_public_id): company = get_object_or_404( Company.objects.member_required(request.user).filter(kind=CompanyKind.GEIQ), pk=company_pk @@ -867,7 +863,6 @@ def geiq_eligibility_criteria_for_hire(request, company_pk, job_seeker_public_id ) -@login_required def hire_confirmation( request, company_pk, diff --git a/itou/www/approvals_views/views.py b/itou/www/approvals_views/views.py index 3c0eea7582..05b08209e0 100644 --- a/itou/www/approvals_views/views.py +++ b/itou/www/approvals_views/views.py @@ -4,7 +4,6 @@ from datetime import timedelta from django.contrib import messages -from django.contrib.auth.decorators import login_required from django.contrib.auth.mixins import UserPassesTestMixin from django.core.exceptions import PermissionDenied from django.core.files.storage import default_storage @@ -74,7 +73,6 @@ def get_context_data(self, **kwargs): # TODO(xfernandez): remove this redirect view in a few weeks -@login_required def approval_detail_redirect_to_employee_view(request, pk): siae = get_current_company_or_404(request) @@ -308,7 +306,6 @@ def prolongation_back_url(request): return get_safe_url(request, "back_url", fallback_url=reverse("dashboard:index")) -@login_required def declare_prolongation(request, approval_id, template_name="approvals/declare_prolongation.html"): """ Declare a prolongation for the given approval. @@ -468,7 +465,6 @@ class CheckContactDetailsView(DeclareProlongationHTMXFragmentView): clear_errors = ("contact_email", "contact_phone") -@login_required def prolongation_requests_list(request, template_name="approvals/prolongation_requests/list.html"): current_organization = get_current_org_or_404(request) if not current_organization.is_authorized: @@ -491,7 +487,6 @@ def prolongation_requests_list(request, template_name="approvals/prolongation_re @require_safe -@login_required def prolongation_request_report_file(request, prolongation_request_id): prolongation_request = get_object_or_404( ProlongationRequest, @@ -588,7 +583,6 @@ def get_step_url(self, step): return reverse(self.url_name, kwargs={"prolongation_request_id": self.prolongation_request.pk, "step": step}) -@login_required def suspend(request, approval_id, template_name="approvals/suspend.html"): siae = get_current_company_or_404(request) approval = get_object_or_404(Approval, pk=approval_id) @@ -623,7 +617,6 @@ def suspend(request, approval_id, template_name="approvals/suspend.html"): return render(request, template_name, context) -@login_required() def suspension_action_choice(request, suspension_id, template_name="approvals/suspension_action_choice.html"): siae = get_current_company_or_404(request) suspension = get_object_or_404( @@ -666,7 +659,6 @@ def suspension_action_choice(request, suspension_id, template_name="approvals/su return render(request, template_name, context) -@login_required def suspension_update(request, suspension_id, template_name="approvals/suspension_update.html"): """ Edit the given suspension. @@ -705,7 +697,6 @@ def suspension_update(request, suspension_id, template_name="approvals/suspensio return render(request, template_name, context) -@login_required() def suspension_update_enddate(request, suspension_id, template_name="approvals/suspension_update_enddate.html"): siae = get_current_company_or_404(request) suspension = get_object_or_404( @@ -748,7 +739,6 @@ def suspension_update_enddate(request, suspension_id, template_name="approvals/s return render(request, template_name, context) -@login_required def suspension_delete(request, suspension_id, template_name="approvals/suspension_delete.html"): """ Delete the given suspension. diff --git a/itou/www/autocomplete/views.py b/itou/www/autocomplete/views.py index a27081e9c7..2d3eaf0ea7 100644 --- a/itou/www/autocomplete/views.py +++ b/itou/www/autocomplete/views.py @@ -1,6 +1,6 @@ from datetime import datetime -from django.contrib.auth.decorators import login_not_required, login_required +from django.contrib.auth.decorators import login_not_required from django.db.models import F, Q, Value from django.db.models.functions import Least, Lower, NullIf, StrIndex from django.http import JsonResponse @@ -126,7 +126,6 @@ def communes_autocomplete(request): return JsonResponse({"results": communes}, safe=False) -@login_required @check_user(is_allowed_to_use_gps_advanced_features) def gps_users_autocomplete(request): """ diff --git a/itou/www/companies_views/views.py b/itou/www/companies_views/views.py index 9b1efa4dcf..266152e122 100644 --- a/itou/www/companies_views/views.py +++ b/itou/www/companies_views/views.py @@ -3,7 +3,7 @@ from django.conf import settings from django.contrib import messages -from django.contrib.auth.decorators import login_not_required, login_required +from django.contrib.auth.decorators import login_not_required from django.core.cache import caches from django.core.exceptions import PermissionDenied from django.db.models import Count, Q @@ -110,7 +110,6 @@ def report_tally_url(user, company, job_description=None): ### Main company view -@login_required def overview(request, template_name="companies/overview.html"): company = get_current_company_or_404(request) @@ -170,7 +169,6 @@ def get_context_data(self, **kwargs): } -@login_required def job_description_list(request, template_name="companies/job_description_list.html"): company = get_current_company_or_404(request) job_descriptions = ( @@ -268,7 +266,6 @@ def _get_job_description(session_data): return None -@login_required def edit_job_description(request, template_name="companies/edit_job_description.html"): company = get_current_company_or_404(request) session_data = request.session.get(ITOU_SESSION_JOB_DESCRIPTION_KEY) or {} @@ -285,7 +282,6 @@ def edit_job_description(request, template_name="companies/edit_job_description. return render(request, template_name, {"form": form}) -@login_required def edit_job_description_details(request, template_name="companies/edit_job_description_details.html"): company = get_current_company_or_404(request) session_data = request.session.get(ITOU_SESSION_JOB_DESCRIPTION_KEY) @@ -318,7 +314,6 @@ def edit_job_description_details(request, template_name="companies/edit_job_desc return render(request, template_name, context) -@login_required def edit_job_description_preview(request, template_name="companies/edit_job_description_preview.html"): company = get_current_company_or_404(request) session_data = request.session.get(ITOU_SESSION_JOB_DESCRIPTION_KEY) @@ -359,7 +354,6 @@ def edit_job_description_preview(request, template_name="companies/edit_job_desc return render(request, template_name, context) -@login_required def update_job_description(request, job_description_id): request.session[ITOU_SESSION_JOB_DESCRIPTION_KEY] = {"pk": job_description_id} return HttpResponseRedirect(reverse("companies_views:edit_job_description")) @@ -368,7 +362,6 @@ def update_job_description(request, job_description_id): ### Financial annexes views -@login_required def show_financial_annexes(request, template_name="companies/show_financial_annexes.html"): """ Show a summary of the financial annexes of the convention to the siae admin user. Financial annexes are grouped @@ -413,7 +406,6 @@ def show_financial_annexes(request, template_name="companies/show_financial_anne return render(request, template_name, context) -@login_required def select_financial_annex(request, template_name="companies/select_financial_annex.html"): """ Let siae admin user select a new convention via a financial annex number. @@ -498,7 +490,6 @@ def get_context_data(self, **kwargs): } -@login_required def create_company(request, template_name="companies/create_siae.html"): current_compny = get_current_company_or_404(request) if not request.user.can_create_siae_antenna(parent_siae=current_compny): @@ -523,7 +514,6 @@ def create_company(request, template_name="companies/create_siae.html"): return render(request, template_name, context) -@login_required def edit_company_step_contact_infos(request, template_name="companies/edit_siae.html"): if ITOU_SESSION_EDIT_COMPANY_KEY not in request.session: request.session[ITOU_SESSION_EDIT_COMPANY_KEY] = {} @@ -552,7 +542,6 @@ def edit_company_step_contact_infos(request, template_name="companies/edit_siae. return render(request, template_name, context) -@login_required def edit_company_step_description(request, template_name="companies/edit_siae_description.html"): if ITOU_SESSION_EDIT_COMPANY_KEY not in request.session: return HttpResponseRedirect(reverse("companies_views:edit_company_step_contact_infos")) @@ -574,7 +563,6 @@ def edit_company_step_description(request, template_name="companies/edit_siae_de return render(request, template_name, context) -@login_required def edit_company_step_preview(request, template_name="companies/edit_siae_preview.html"): if ITOU_SESSION_EDIT_COMPANY_KEY not in request.session: return HttpResponseRedirect(reverse("companies_views:edit_company_step_contact_infos")) @@ -624,7 +612,6 @@ def edit_company_step_preview(request, template_name="companies/edit_siae_previe ### Company memberships views -@login_required def members(request, template_name="companies/members.html"): company = get_current_company_or_404(request) if not company.is_active: @@ -648,7 +635,6 @@ def members(request, template_name="companies/members.html"): return render(request, template_name, context) -@login_required def deactivate_member(request, user_id, template_name="companies/deactivate_member.html"): company = get_current_company_or_404(request) target_member = User.objects.get(pk=user_id) @@ -664,7 +650,6 @@ def deactivate_member(request, user_id, template_name="companies/deactivate_memb return render(request, template_name, context) -@login_required def update_admin_role(request, action, user_id, template_name="companies/update_admins.html"): company = get_current_company_or_404(request) target_member = User.objects.get(pk=user_id) diff --git a/itou/www/dashboard/views.py b/itou/www/dashboard/views.py index 73c69f1ca7..47d51c8725 100644 --- a/itou/www/dashboard/views.py +++ b/itou/www/dashboard/views.py @@ -2,7 +2,6 @@ from django.conf import settings from django.contrib import auth, messages from django.contrib.auth import REDIRECT_FIELD_NAME -from django.contrib.auth.decorators import login_required from django.core.exceptions import PermissionDenied from django.db.models import F from django.http import Http404, HttpResponseForbidden, HttpResponseRedirect @@ -107,7 +106,6 @@ def _employer_dashboard_context(request): } -@login_required def dashboard(request, template_name="dashboard/dashboard.html"): context = { "active_geiq_campaign": None, @@ -158,7 +156,6 @@ def dashboard(request, template_name="dashboard/dashboard.html"): return render(request, template_name, context) -@login_required def dashboard_stats(request, template_name="dashboard/dashboard_stats.html"): if not stats_utils.can_view_stats_dashboard_widget(request): return HttpResponseForbidden() @@ -205,10 +202,9 @@ class ItouPasswordChangeView(PasswordChangeView): success_url = reverse_lazy("dashboard:index") -password_change = login_required(ItouPasswordChangeView.as_view()) +password_change = ItouPasswordChangeView.as_view() -@login_required def edit_user_email(request, template_name="dashboard/edit_user_email.html"): if request.user.has_sso_provider: return HttpResponseForbidden() @@ -227,7 +223,6 @@ def edit_user_email(request, template_name="dashboard/edit_user_email.html"): return render(request, template_name, context) -@login_required def edit_user_info(request, template_name="dashboard/edit_user_info.html"): """ Edit a user. @@ -281,7 +276,6 @@ def edit_user_info(request, template_name="dashboard/edit_user_info.html"): return render(request, template_name, context) -@login_required def edit_job_seeker_info(request, job_seeker_public_id, template_name="dashboard/edit_job_seeker_info.html"): job_seeker = get_object_or_404( User.objects.filter(kind=UserKind.JOB_SEEKER).select_related("jobseeker_profile"), @@ -316,7 +310,6 @@ def edit_job_seeker_info(request, job_seeker_public_id, template_name="dashboard return render(request, template_name, context) -@login_required @require_POST def switch_organization(request): pk = request.POST["organization_id"] @@ -335,7 +328,6 @@ def switch_organization(request): return HttpResponseRedirect(reverse("dashboard:index")) -@login_required def edit_user_notifications(request, template_name="dashboard/edit_user_notifications.html"): if request.user.is_staff: raise Http404("L'utilisateur admin ne peut gérer ses notifications.") @@ -365,7 +357,6 @@ def edit_user_notifications(request, template_name="dashboard/edit_user_notifica return render(request, template_name, context) -@login_required def api_token(request, template_name="dashboard/api_token.html"): if not (request.user.is_employer and request.is_current_organization_admin): raise PermissionDenied diff --git a/itou/www/employee_record_views/views.py b/itou/www/employee_record_views/views.py index c51e42ec54..91dbed8c38 100644 --- a/itou/www/employee_record_views/views.py +++ b/itou/www/employee_record_views/views.py @@ -1,5 +1,4 @@ from django.contrib import messages -from django.contrib.auth.decorators import login_required from django.core.exceptions import PermissionDenied, ValidationError from django.db.models import Count from django.http.response import HttpResponseRedirect @@ -142,7 +141,6 @@ def done(self, form_list, *args, **kwargs): ) -@login_required @require_safe def list_employee_records(request, template_name="employee_record/list.html"): siae = get_current_company_or_404(request) @@ -218,7 +216,6 @@ def list_employee_records(request, template_name="employee_record/list.html"): return render(request, "employee_record/includes/list_results.html" if request.htmx else template_name, context) -@login_required def create(request, job_application_id, template_name="employee_record/create.html"): """ Create a new employee record from a given job application @@ -247,7 +244,6 @@ def create(request, job_application_id, template_name="employee_record/create.ht return render(request, template_name, context) -@login_required def create_step_2(request, job_application_id, template_name="employee_record/create.html"): """ Create a new employee record from a given job application @@ -301,7 +297,6 @@ def create_step_2(request, job_application_id, template_name="employee_record/cr return render(request, template_name, context) -@login_required def create_step_3(request, job_application_id, template_name="employee_record/create.html"): """ Create a new employee record from a given job application @@ -364,7 +359,6 @@ def create_step_3(request, job_application_id, template_name="employee_record/cr return render(request, template_name, context) -@login_required def create_step_4(request, job_application_id, template_name="employee_record/create.html"): """ Create a new employee record from a given job application @@ -401,7 +395,6 @@ def create_step_4(request, job_application_id, template_name="employee_record/cr return render(request, template_name, context) -@login_required def create_step_5(request, job_application_id, template_name="employee_record/create.html"): """ Create a new employee record from a given job application @@ -440,7 +433,6 @@ def create_step_5(request, job_application_id, template_name="employee_record/cr return render(request, template_name, context) -@login_required def summary(request, employee_record_id, template_name="employee_record/summary.html"): siae = get_current_company_or_404(request) @@ -462,7 +454,6 @@ def summary(request, employee_record_id, template_name="employee_record/summary. return render(request, template_name, context) -@login_required def disable(request, employee_record_id, template_name="employee_record/disable.html"): siae = get_current_company_or_404(request) @@ -493,7 +484,6 @@ def disable(request, employee_record_id, template_name="employee_record/disable. return render(request, template_name, context) -@login_required def reactivate(request, employee_record_id, template_name="employee_record/reactivate.html"): siae = get_current_company_or_404(request) diff --git a/itou/www/geiq_views/views.py b/itou/www/geiq_views/views.py index d8755e8f05..2330c763eb 100644 --- a/itou/www/geiq_views/views.py +++ b/itou/www/geiq_views/views.py @@ -3,7 +3,6 @@ import logging from django.contrib import messages -from django.contrib.auth.decorators import login_required from django.core.exceptions import ImproperlyConfigured from django.core.files.storage import default_storage from django.db.models import Count, F, OuterRef, Prefetch, Q, Subquery, Sum @@ -65,7 +64,6 @@ def _get_assessments_for_labor_inspector(request): ) -@login_required @check_user(lambda user: user.is_active and (user.is_employer or user.is_labor_inspector)) def assessment_info(request, assessment_pk): if request.user.is_employer: @@ -131,7 +129,6 @@ def _assessment_info_for_labor_inspector( return render(request, template_name, context) -@login_required @check_user(lambda user: user.is_active and user.is_labor_inspector) def assessment_review(request, assessment_pk, template_name="geiq/assessment_review.html"): assessment = get_object_or_404(_get_assessments_for_labor_inspector(request), pk=assessment_pk) @@ -154,7 +151,6 @@ def assessment_review(request, assessment_pk, template_name="geiq/assessment_rev return render(request, template_name, context) -@login_required @check_user(lambda user: user.is_active and (user.is_employer or user.is_labor_inspector)) def employee_list(request, assessment_pk, info_type): try: @@ -248,7 +244,6 @@ def _lock_assessment_and_sync(assessment): return True -@login_required @require_POST @check_user(lambda user: user.is_active and user.is_employer) def label_sync(request, assessment_pk): @@ -268,7 +263,6 @@ def label_sync(request, assessment_pk): return render(request, "geiq/includes/last_synced_at.html", context) -@login_required @require_safe @check_user(lambda user: user.is_active and (user.is_employer or user.is_labor_inspector)) def employee_details(request, employee_pk): @@ -297,7 +291,6 @@ def employee_details(request, employee_pk): return render(request, "geiq/employee_details.html", context) -@login_required @check_user(lambda user: user.is_active and user.is_labor_inspector) def geiq_list(request, institution_pk, year=None, template_name="geiq/geiq_list.html"): institution = get_object_or_404( @@ -336,7 +329,6 @@ def geiq_list(request, institution_pk, year=None, template_name="geiq/geiq_list. @require_safe -@login_required @check_user(lambda user: user.is_active and (user.is_employer or user.is_labor_inspector)) def assessment_report(request, assessment_pk): if request.user.is_labor_inspector: diff --git a/itou/www/gps/views.py b/itou/www/gps/views.py index adb60c7b81..f659115117 100644 --- a/itou/www/gps/views.py +++ b/itou/www/gps/views.py @@ -1,4 +1,3 @@ -from django.contrib.auth.decorators import login_required from django.db.models import Count from django.http import HttpResponseRedirect from django.shortcuts import render @@ -19,7 +18,6 @@ def is_allowed_to_use_gps_advanced_features(user): return user.is_employer or user.is_prescriber_with_authorized_org -@login_required @check_user(is_allowed_to_use_gps) def my_groups(request, template_name="gps/my_groups.html"): memberships = ( @@ -47,7 +45,6 @@ def my_groups(request, template_name="gps/my_groups.html"): return render(request, "gps/includes/memberships_results.html" if request.htmx else template_name, context) -@login_required @check_user(is_allowed_to_use_gps_advanced_features) def join_group(request, template_name="gps/join_group.html"): form = GpsUserSearchForm(data=request.POST or None) @@ -71,7 +68,6 @@ def join_group(request, template_name="gps/join_group.html"): return render(request, template_name, context) -@login_required @check_user(is_allowed_to_use_gps) def leave_group(request, group_id): membership = ( @@ -85,7 +81,6 @@ def leave_group(request, group_id): return HttpResponseRedirect(reverse("gps:my_groups")) -@login_required @check_user(is_allowed_to_use_gps) def toggle_referent(request, group_id): membership = ( diff --git a/itou/www/institutions_views/views.py b/itou/www/institutions_views/views.py index e6fe2e2167..1948515cde 100644 --- a/itou/www/institutions_views/views.py +++ b/itou/www/institutions_views/views.py @@ -1,4 +1,3 @@ -from django.contrib.auth.decorators import login_required from django.db.models import Count, Q from django.http import HttpResponseRedirect from django.shortcuts import render @@ -9,7 +8,6 @@ from itou.utils.perms.institution import get_current_institution_or_404 -@login_required def member_list(request, template_name="institutions/members.html"): """ List members of an institution. @@ -39,7 +37,6 @@ def member_list(request, template_name="institutions/members.html"): return render(request, template_name, context) -@login_required def deactivate_member(request, user_id, template_name="institutions/deactivate_member.html"): institution = get_current_institution_or_404(request) target_member = User.objects.get(pk=user_id) @@ -55,7 +52,6 @@ def deactivate_member(request, user_id, template_name="institutions/deactivate_m return render(request, template_name, context) -@login_required def update_admin_role(request, action, user_id, template_name="institutions/update_admins.html"): institution = get_current_institution_or_404(request) target_member = User.objects.get(pk=user_id) diff --git a/itou/www/invitations_views/views.py b/itou/www/invitations_views/views.py index 740c11b910..e5aa2fed74 100644 --- a/itou/www/invitations_views/views.py +++ b/itou/www/invitations_views/views.py @@ -3,7 +3,7 @@ from allauth.account.adapter import get_adapter from django.conf import settings from django.contrib import messages -from django.contrib.auth.decorators import login_not_required, login_required +from django.contrib.auth.decorators import login_not_required from django.http import HttpResponseRedirect from django.shortcuts import get_object_or_404, redirect, render, reverse from django.utils import formats, safestring @@ -121,7 +121,6 @@ def new_user(request, invitation_type, invitation_id): return handle_registration(request, invitation, invitation_type) -@login_required def invite_prescriber_with_org(request, template_name="invitations_views/create.html"): organization = get_current_org_or_404(request) form_kwargs = {"sender": request.user, "organization": organization} @@ -180,7 +179,6 @@ def invite_prescriber_with_org(request, template_name="invitations_views/create. return render(request, template_name, context) -@login_required def join_prescriber_organization(request, invitation_id): invitation = get_object_or_404(PrescriberWithOrgInvitation, pk=invitation_id) handle_prescriber_intivation(invitation, request) @@ -189,7 +187,6 @@ def join_prescriber_organization(request, invitation_id): return HttpResponseRedirect(url) -@login_required def invite_employer(request, template_name="invitations_views/create.html"): form_post_url = reverse("invitations_views:invite_employer") back_url = reverse("companies_views:members") @@ -214,7 +211,6 @@ def invite_employer(request, template_name="invitations_views/create.html"): return render(request, template_name, context) -@login_required def join_company(request, invitation_id): invitation = get_object_or_404(EmployerInvitation, pk=invitation_id) handle_employer_invitation(invitation, request) @@ -223,7 +219,6 @@ def join_company(request, invitation_id): return HttpResponseRedirect(url) -@login_required def invite_labor_inspector(request, template_name="invitations_views/create.html"): institution = get_current_institution_or_404(request) form_kwargs = {"sender": request.user, "institution": institution} @@ -264,7 +259,6 @@ def invite_labor_inspector(request, template_name="invitations_views/create.html return render(request, template_name, context) -@login_required def join_institution(request, invitation_id): invitation = get_object_or_404(LaborInspectorInvitation, pk=invitation_id) handle_labor_inspector_invitation(invitation, request) diff --git a/itou/www/itou_staff_views/views.py b/itou/www/itou_staff_views/views.py index 8c35147d9a..2418c43f06 100644 --- a/itou/www/itou_staff_views/views.py +++ b/itou/www/itou_staff_views/views.py @@ -4,7 +4,6 @@ from dateutil.relativedelta import relativedelta from django.contrib import messages -from django.contrib.auth.decorators import login_required from django.db.models import Q from django.http import FileResponse, HttpResponseRedirect, StreamingHttpResponse from django.shortcuts import get_object_or_404, render @@ -38,7 +37,6 @@ def write(self, value): return value -@login_required @check_user(lambda user: user.is_superuser) def export_job_applications_unknown_to_ft( request, @@ -111,7 +109,6 @@ def content(): return render(request, template_name, {"form": form}) -@login_required @check_user(lambda user: user.is_superuser) def export_ft_api_rejections(request): first_day_of_month = timezone.now().replace(day=1, hour=0, minute=0, second=0, microsecond=0) @@ -174,7 +171,6 @@ def export_ft_api_rejections(request): ) -@login_required @check_user(lambda user: user.is_superuser) def export_cta(request): employees_qs = CompanyMembership.objects.active().select_related("company", "user") @@ -200,7 +196,6 @@ def content(): ) -@login_required @check_user(lambda user: user.is_superuser) def merge_users(request, template_name="itou_staff_views/merge_users.html"): form = MergeUserForm(data=request.POST or None) @@ -216,7 +211,6 @@ def merge_users(request, template_name="itou_staff_views/merge_users.html"): return render(request, template_name, {"form": form}) -@login_required @check_user(lambda user: user.is_superuser) def merge_users_confirm(request, user_1_pk, user_2_pk, template_name="itou_staff_views/merge_users_confirm.html"): ALLOWED_USER_KINDS = [UserKind.PRESCRIBER, UserKind.EMPLOYER] diff --git a/itou/www/prescribers_views/views.py b/itou/www/prescribers_views/views.py index b712848e97..ad0e2fd4cf 100644 --- a/itou/www/prescribers_views/views.py +++ b/itou/www/prescribers_views/views.py @@ -1,5 +1,5 @@ from django.contrib import messages -from django.contrib.auth.decorators import login_not_required, login_required +from django.contrib.auth.decorators import login_not_required from django.core.exceptions import PermissionDenied from django.db.models import Count, Q from django.http import HttpResponseRedirect @@ -28,7 +28,6 @@ def card(request, org_id, template_name="prescribers/card.html"): return render(request, template_name, context) -@login_required def edit_organization(request, template_name="prescribers/edit_organization.html"): organization = get_current_org_or_404(request) if not organization.has_admin(request.user): @@ -48,7 +47,6 @@ def edit_organization(request, template_name="prescribers/edit_organization.html return render(request, template_name, context) -@login_required def member_list(request, template_name="prescribers/members.html"): """ List members of a prescriber organization. @@ -74,7 +72,6 @@ def member_list(request, template_name="prescribers/members.html"): return render(request, template_name, context) -@login_required def deactivate_member(request, user_id, template_name="prescribers/deactivate_member.html"): organization = get_current_org_or_404(request) target_member = User.objects.get(pk=user_id) @@ -90,7 +87,6 @@ def deactivate_member(request, user_id, template_name="prescribers/deactivate_me return render(request, template_name, context) -@login_required def update_admin_role(request, action, user_id, template_name="prescribers/update_admins.html"): organization = get_current_org_or_404(request) target_member = User.objects.get(pk=user_id) @@ -107,7 +103,6 @@ def update_admin_role(request, action, user_id, template_name="prescribers/updat return render(request, template_name, context) -@login_required def list_accredited_organizations(request, template_name="prescribers/list_accredited_organizations.html"): """ List organizations accredited by a departmental council ("Conseil Départemental"). diff --git a/itou/www/siae_evaluations_views/views.py b/itou/www/siae_evaluations_views/views.py index 18079d351c..49600050a4 100644 --- a/itou/www/siae_evaluations_views/views.py +++ b/itou/www/siae_evaluations_views/views.py @@ -1,5 +1,5 @@ from django.contrib import messages -from django.contrib.auth.decorators import login_not_required, login_required +from django.contrib.auth.decorators import login_not_required from django.core.files.storage import default_storage from django.db.models import Q from django.http import Http404, HttpResponseForbidden, HttpResponseRedirect @@ -37,7 +37,6 @@ ) -@login_required @check_user(lambda user: user.is_labor_inspector) def samples_selection(request, template_name="siae_evaluations/samples_selection.html"): institution = get_current_institution_or_404(request) @@ -72,7 +71,6 @@ def samples_selection(request, template_name="siae_evaluations/samples_selection return render(request, template_name, context) -@login_required def campaign_calendar(request, evaluation_campaign_pk, template_name="siae_evaluations/campaign_calendar.html"): evaluation_campaign = get_object_or_404( EvaluationCampaign, @@ -86,7 +84,6 @@ def campaign_calendar(request, evaluation_campaign_pk, template_name="siae_evalu return render(request, template_name, context) -@login_required @check_user(lambda user: user.is_labor_inspector) def institution_evaluated_siae_list( request, evaluation_campaign_pk, template_name="siae_evaluations/institution_evaluated_siae_list.html" @@ -118,7 +115,6 @@ def institution_evaluated_siae_list( return render(request, template_name, context) -@login_required @check_user(lambda user: user.is_labor_inspector or user.is_employer) def evaluated_siae_detail(request, evaluated_siae_pk, template_name="siae_evaluations/evaluated_siae_detail.html"): owner_data = {} @@ -346,7 +342,6 @@ def get_success_url(self): ) -@login_required @check_user(lambda user: user.is_labor_inspector or user.is_employer) def evaluated_siae_sanction(request, evaluated_siae_pk, viewer_type): allowed_viewers = { @@ -374,7 +369,6 @@ def evaluated_siae_sanction(request, evaluated_siae_pk, viewer_type): return render(request, "siae_evaluations/evaluated_siae_sanction.html", context) -@login_required def evaluated_job_application( request, evaluated_job_application_pk, template_name="siae_evaluations/evaluated_job_application.html" ): @@ -454,7 +448,6 @@ def evaluated_job_application( return render(request, template_name, context) -@login_required @require_POST def institution_evaluated_administrative_criteria(request, evaluated_administrative_criteria_pk, action): institution = get_current_institution_or_404(request) @@ -486,7 +479,6 @@ def institution_evaluated_administrative_criteria(request, evaluated_administrat ) -@login_required @require_POST def institution_evaluated_siae_validation(request, evaluated_siae_pk): institution = get_current_institution_or_404(request) @@ -519,7 +511,6 @@ def institution_evaluated_siae_validation(request, evaluated_siae_pk): ) -@login_required def siae_job_applications_list( request, evaluated_siae_pk, @@ -555,7 +546,6 @@ def siae_job_applications_list( return render(request, template_name, context) -@login_required def siae_select_criteria( request, evaluated_job_application_pk, template_name="siae_evaluations/siae_select_criteria.html" ): @@ -628,7 +618,6 @@ def siae_select_criteria( return render(request, template_name, context) -@login_required def siae_upload_doc( request, evaluated_administrative_criteria_pk, template_name="siae_evaluations/siae_upload_doc.html" ): @@ -676,7 +665,6 @@ def siae_upload_doc( return render(request, template_name, context) -@login_required @require_POST def siae_submit_proofs(request, evaluated_siae_pk): evaluated_siae = get_object_or_404( @@ -723,7 +711,6 @@ def siae_submit_proofs(request, evaluated_siae_pk): return HttpResponseRedirect(back_url) -@login_required @require_safe def view_proof(request, evaluated_administrative_criteria_id): if request.user.is_employer: diff --git a/itou/www/signup/views.py b/itou/www/signup/views.py index 664de9eea7..105d98e146 100644 --- a/itou/www/signup/views.py +++ b/itou/www/signup/views.py @@ -9,7 +9,7 @@ from django.conf import settings from django.contrib import auth, messages from django.contrib.auth import REDIRECT_FIELD_NAME, login -from django.contrib.auth.decorators import login_not_required, login_required +from django.contrib.auth.decorators import login_not_required from django.core.exceptions import PermissionDenied from django.db import Error, transaction from django.http import HttpResponseRedirect @@ -739,7 +739,6 @@ def prescriber_user(request, template_name="signup/prescriber_user.html"): @valid_prescriber_signup_session_required @push_url_in_history(global_constants.ITOU_SESSION_PRESCRIBER_SIGNUP_KEY) -@login_required def prescriber_join_org(request): """ User is redirected here after a successful oauth signup. diff --git a/itou/www/stats/views.py b/itou/www/stats/views.py index 029021c460..98c24ba776 100644 --- a/itou/www/stats/views.py +++ b/itou/www/stats/views.py @@ -15,7 +15,7 @@ """ from django.conf import settings -from django.contrib.auth.decorators import login_not_required, login_required +from django.contrib.auth.decorators import login_not_required from django.core.exceptions import PermissionDenied from django.http import HttpResponseNotFound, HttpResponseRedirect from django.shortcuts import render @@ -187,7 +187,6 @@ def stats_public(request): return render_stats(request=request, context=context) -@login_required def stats_redirect(request, dashboard_name): match request.user.kind: case UserKind.LABOR_INSPECTOR: @@ -198,7 +197,6 @@ def stats_redirect(request, dashboard_name): return HttpResponseRedirect(reverse(f"stats:stats_{normalized_organization_kind}_{dashboard_name}")) -@login_required def stats_siae_aci(request): """ ACI stats shown to their own members. @@ -219,7 +217,6 @@ def stats_siae_aci(request): ) -@login_required def stats_siae_etp(request): """ SIAE stats shown to their own members. @@ -247,7 +244,6 @@ def stats_siae_etp(request): ) -@login_required def stats_siae_orga_etp(request): """ SIAE stats shown to their own members. @@ -295,22 +291,18 @@ def render_stats_siae(request, page_title): ) -@login_required def stats_siae_hiring(request): return render_stats_siae(request=request, page_title="Données de candidatures de mes structures") -@login_required def stats_siae_auto_prescription(request): return render_stats_siae(request=request, page_title="Focus auto-prescription") -@login_required def stats_siae_follow_siae_evaluation(request): return render_stats_siae(request=request, page_title="Suivi du contrôle a posteriori") -@login_required def stats_siae_hiring_report(request): return render_stats_siae(request=request, page_title="Déclaration d’embauche") @@ -335,22 +327,18 @@ def render_stats_cd(request, page_title, *, params=None, extra_context=None): return render_stats(request=request, context=context, params=params) -@login_required def stats_cd_iae(request): return render_stats_cd(request=request, page_title="Données IAE") -@login_required def stats_cd_hiring(request): return render_stats_cd(request=request, page_title="Facilitation des embauches en IAE") -@login_required def stats_cd_brsa(request): return render_stats_cd(request=request, page_title="Suivi des prescriptions des accompagnateurs des publics bRSA") -@login_required def stats_cd_aci(request): current_org = get_current_org_or_404(request) if not utils.can_view_stats_cd_aci(request): @@ -363,7 +351,6 @@ def stats_cd_aci(request): ) -@login_required() def stats_cd_orga_etp(request): get_current_org_or_404(request) if not utils.can_view_stats_cd_orga_etp(request): @@ -421,7 +408,6 @@ def render_stats_ft(request, page_title, extra_params=None): return render_stats(request=request, context=context, params=params) -@login_required def stats_ft_delay_main(request): return render_stats_ft( request=request, @@ -432,7 +418,6 @@ def stats_ft_delay_main(request): ) -@login_required def stats_ft_delay_raw(request): return render_stats_ft( request=request, @@ -441,7 +426,6 @@ def stats_ft_delay_raw(request): ) -@login_required def stats_ft_conversion_main(request): return render_stats_ft( request=request, @@ -452,7 +436,6 @@ def stats_ft_conversion_main(request): ) -@login_required def stats_ft_conversion_raw(request): return render_stats_ft( request=request, @@ -463,7 +446,6 @@ def stats_ft_conversion_raw(request): ) -@login_required def stats_ft_state_main(request): allowed_org_pks = list( PrescriberOrganization.objects.filter( @@ -481,7 +463,6 @@ def stats_ft_state_main(request): ) -@login_required def stats_ft_state_raw(request): return render_stats_ft( request=request, @@ -492,7 +473,6 @@ def stats_ft_state_raw(request): ) -@login_required def stats_ft_tension(request): return render_stats_ft( request=request, @@ -522,7 +502,6 @@ def render_stats_ph(request, page_title, *, extra_params=None, extra_context=Non return render_stats(request=request, context=context, params=params) -@login_required def stats_ph_state_main(request): if not utils.can_view_stats_ph(request): raise PermissionDenied @@ -583,37 +562,30 @@ def render_stats_ddets_iae(request, page_title, extra_context=None, extend_stats ) -@login_required def stats_ddets_iae_auto_prescription(request): return render_stats_ddets_iae(request=request, page_title="Focus auto-prescription") -@login_required def stats_ddets_iae_ph_prescription(request): return render_stats_ddets_iae(request=request, page_title="Suivi des prescriptions des prescripteurs habilités") -@login_required def stats_ddets_iae_follow_siae_evaluation(request): return render_stats_ddets_iae(request=request, page_title="Suivi du contrôle à posteriori") -@login_required def stats_ddets_iae_follow_prolongation(request): return render_stats_ddets_iae(request=request, page_title="Suivi des demandes de prolongation") -@login_required def stats_ddets_iae_tension(request): return render_stats_ddets_iae(request=request, page_title="SIAE qui peinent à recruter sur le territoire") -@login_required def stats_ddets_iae_iae(request): return render_stats_ddets_iae(request=request, page_title="Données IAE de mon département") -@login_required def stats_ddets_iae_siae_evaluation(request): extra_context = { "back_url": reverse("siae_evaluations_views:samples_selection"), @@ -624,7 +596,6 @@ def stats_ddets_iae_siae_evaluation(request): ) -@login_required def stats_ddets_iae_hiring(request): return render_stats_ddets_iae( request=request, @@ -632,7 +603,6 @@ def stats_ddets_iae_hiring(request): ) -@login_required def stats_ddets_iae_state(request): return render_stats_ddets_iae( request=request, @@ -641,7 +611,6 @@ def stats_ddets_iae_state(request): ) -@login_required def stats_ddets_iae_aci(request): current_org = get_current_institution_or_404(request) if not utils.can_view_stats_ddets_iae_aci(request): @@ -654,7 +623,6 @@ def stats_ddets_iae_aci(request): ) -@login_required def stats_ddets_iae_orga_etp(request): if not utils.can_view_stats_ddets_iae_orga_etp(request): raise PermissionDenied @@ -677,7 +645,6 @@ def render_stats_ddets_log(request, page_title, extend_stats_to_whole_region): ) -@login_required def stats_ddets_log_state(request): return render_stats_ddets_log( request=request, @@ -698,32 +665,26 @@ def render_stats_dreets_iae(request, page_title, *, extra_context=None): return render_stats(request=request, context=context, params=params) -@login_required def stats_dreets_iae_auto_prescription(request): return render_stats_dreets_iae(request=request, page_title="Focus auto-prescription") -@login_required def stats_dreets_iae_ph_prescription(request): return render_stats_dreets_iae(request=request, page_title="Suivi des prescriptions des prescripteurs habilités") -@login_required def stats_dreets_iae_follow_siae_evaluation(request): return render_stats_dreets_iae(request=request, page_title="Suivi du contrôle à posteriori") -@login_required def stats_dreets_iae_follow_prolongation(request): return render_stats_dreets_iae(request=request, page_title="Suivi des demandes de prolongation") -@login_required def stats_dreets_iae_tension(request): return render_stats_dreets_iae(request=request, page_title="SIAE qui peinent à recruter sur le territoire") -@login_required def stats_dreets_iae_iae(request): return render_stats_dreets_iae( request=request, @@ -731,7 +692,6 @@ def stats_dreets_iae_iae(request): ) -@login_required def stats_dreets_iae_hiring(request): return render_stats_dreets_iae( request=request, @@ -739,7 +699,6 @@ def stats_dreets_iae_hiring(request): ) -@login_required def stats_dreets_iae_state(request): return render_stats_dreets_iae( request=request, @@ -747,7 +706,6 @@ def stats_dreets_iae_state(request): ) -@login_required def stats_dreets_iae_orga_etp(request): if not utils.can_view_stats_dreets_iae_orga_etp(request): raise PermissionDenied @@ -771,28 +729,24 @@ def render_stats_dgefp_iae(request, page_title, extra_params=None, extra_context return render_stats(request=request, context=context, params=extra_params) -@login_required def stats_dgefp_iae_auto_prescription(request): return render_stats_dgefp_iae( request=request, page_title="Focus auto-prescription", extra_params=get_params_for_whole_country() ) -@login_required def stats_dgefp_iae_follow_siae_evaluation(request): return render_stats_dgefp_iae( request=request, page_title="Suivi du contrôle à posteriori", extra_params=get_params_for_whole_country() ) -@login_required def stats_dgefp_iae_follow_prolongation(request): return render_stats_dgefp_iae( request=request, page_title="Suivi des demandes de prolongation", extra_params=get_params_for_whole_country() ) -@login_required def stats_dgefp_iae_tension(request): return render_stats_dgefp_iae( request=request, @@ -801,14 +755,12 @@ def stats_dgefp_iae_tension(request): ) -@login_required def stats_dgefp_iae_hiring(request): return render_stats_dgefp_iae( request=request, page_title="Données facilitation de l'embauche", extra_params=get_params_for_whole_country() ) -@login_required def stats_dgefp_iae_state(request): return render_stats_dgefp_iae( request=request, @@ -817,14 +769,12 @@ def stats_dgefp_iae_state(request): ) -@login_required def stats_dgefp_iae_iae(request): return render_stats_dgefp_iae( request=request, page_title="Données des régions", extra_params=get_params_for_whole_country() ) -@login_required def stats_dgefp_iae_ph_prescription(request): return render_stats_dgefp_iae( request=request, @@ -833,7 +783,6 @@ def stats_dgefp_iae_ph_prescription(request): ) -@login_required def stats_dgefp_iae_siae_evaluation(request): return render_stats_dgefp_iae( request=request, @@ -843,12 +792,10 @@ def stats_dgefp_iae_siae_evaluation(request): ) -@login_required def stats_dgefp_iae_af(request): return render_stats_dgefp_iae(request=request, page_title="Annexes financières actives") -@login_required def stats_dgefp_iae_orga_etp(request): return render_stats_dgefp_iae( request=request, @@ -857,7 +804,6 @@ def stats_dgefp_iae_orga_etp(request): ) -@login_required def stats_dihal_state(request): get_current_institution_or_404(request) if not utils.can_view_stats_dihal(request): @@ -868,7 +814,6 @@ def stats_dihal_state(request): return render_stats(request=request, context=context, params=get_params_for_whole_country()) -@login_required def stats_drihl_state(request): get_current_institution_or_404(request) if not utils.can_view_stats_drihl(request): @@ -879,7 +824,6 @@ def stats_drihl_state(request): return render_stats(request=request, context=context, params=get_params_for_idf_region()) -@login_required def stats_iae_network_hiring(request): current_org = get_current_institution_or_404(request) if not utils.can_view_stats_iae_network(request): @@ -894,7 +838,6 @@ def stats_iae_network_hiring(request): ) -@login_required def stats_convergence_prescription(request): get_current_institution_or_404(request) if not utils.can_view_stats_convergence(request): @@ -907,7 +850,6 @@ def stats_convergence_prescription(request): ) -@login_required def stats_convergence_job_application(request): get_current_institution_or_404(request) if not utils.can_view_stats_convergence(request): @@ -920,7 +862,6 @@ def stats_convergence_job_application(request): ) -@login_required def stats_staff_service_indicators(request): """Indicator statistics for Les Emplois staff""" if not utils.can_view_stats_staff(request): diff --git a/itou/www/welcoming_tour/views.py b/itou/www/welcoming_tour/views.py index 645f33aed6..fc9d8525dc 100644 --- a/itou/www/welcoming_tour/views.py +++ b/itou/www/welcoming_tour/views.py @@ -1,8 +1,6 @@ -from django.contrib.auth.decorators import login_required from django.shortcuts import render -@login_required def index(request): user = request.user template_name = "welcoming_tour/job_seeker.html"