diff --git a/app/components/create_log_actions_component.rb b/app/components/create_log_actions_component.rb index 97b3e8ffa..af8ed9d89 100644 --- a/app/components/create_log_actions_component.rb +++ b/app/components/create_log_actions_component.rb @@ -16,7 +16,7 @@ class CreateLogActionsComponent < ViewComponent::Base return true unless FeatureToggle.new_data_protection_confirmation? return true if user.support? - user.organisation.data_protection_confirmation&.confirmed? + user.organisation.data_protection_confirmed? end def create_button_href diff --git a/app/controllers/organisations_controller.rb b/app/controllers/organisations_controller.rb index e5607e395..7fdcd1d94 100644 --- a/app/controllers/organisations_controller.rb +++ b/app/controllers/organisations_controller.rb @@ -165,7 +165,7 @@ class OrganisationsController < ApplicationController def confirm_data_sharing_agreement return render_not_found unless FeatureToggle.new_data_protection_confirmation? return render_not_found unless current_user.is_dpo? - return render_not_found if @organisation.data_protection_confirmation&.confirmed? + return render_not_found if @organisation.data_protection_confirmed? if @organisation.data_protection_confirmation @organisation.data_protection_confirmation.update!( diff --git a/app/helpers/data_sharing_agreement_helper.rb b/app/helpers/data_sharing_agreement_helper.rb index ee6603feb..278ad722f 100644 --- a/app/helpers/data_sharing_agreement_helper.rb +++ b/app/helpers/data_sharing_agreement_helper.rb @@ -68,7 +68,7 @@ module DataSharingAgreementHelper private def data_sharing_agreement_first_line(organisation:, user:) - return "Not accepted" unless organisation.data_protection_confirmation&.confirmed? + return "Not accepted" unless organisation.data_protection_confirmed? if user.support? "Accepted #{organisation.data_protection_confirmation.created_at.strftime('%d/%m/%Y')}" @@ -78,7 +78,7 @@ private end def data_sharing_agreement_second_line(organisation:, user:) - if organisation.data_protection_confirmation&.confirmed? + if organisation.data_protection_confirmed? organisation.data_protection_confirmation.data_protection_officer.name if user.support? else "Data protection officer must sign" unless user.is_dpo? diff --git a/app/models/log.rb b/app/models/log.rb index 65f9c56e3..6b4c4b324 100644 --- a/app/models/log.rb +++ b/app/models/log.rb @@ -181,7 +181,7 @@ private def verify_dsa_signed return unless FeatureToggle.new_data_protection_confirmation? return unless owning_organisation - return if owning_organisation.data_protection_confirmation&.confirmed? + return if owning_organisation.data_protection_confirmed? errors.add :owning_organisation, I18n.t("validations.organisation.data_sharing_agreement_not_signed") end diff --git a/app/views/logs/_create_for_org_actions.html.erb b/app/views/logs/_create_for_org_actions.html.erb index 087429c16..dc0469c44 100644 --- a/app/views/logs/_create_for_org_actions.html.erb +++ b/app/views/logs/_create_for_org_actions.html.erb @@ -1,5 +1,5 @@
- <% if !FeatureToggle.new_data_protection_confirmation? || @organisation.data_protection_confirmation&.confirmed? %> + <% if !FeatureToggle.new_data_protection_confirmation? || @organisation.data_protection_confirmed? %> <% if current_page?(controller: 'organisations', action: 'lettings_logs') %> <%= govuk_button_to "Create a new lettings log for this organisation", lettings_logs_path(lettings_log: { owning_organisation_id: @organisation.id }, method: :post) %> <% end %> diff --git a/app/views/organisations/data_sharing_agreement.html.erb b/app/views/organisations/data_sharing_agreement.html.erb index b7ceaf243..02da03f53 100644 --- a/app/views/organisations/data_sharing_agreement.html.erb +++ b/app/views/organisations/data_sharing_agreement.html.erb @@ -134,7 +134,7 @@
  • Title: Deputy Director
  • - <% if current_user.is_dpo? && !(@organisation.data_protection_confirmation&.confirmed?) %> + <% if current_user.is_dpo? && !(@organisation.data_protection_confirmed?) %>
    <%= govuk_button_to("Accept this agreement", data_sharing_agreement_organisation_path(@organisation), method: :post) %> <%= govuk_button_link_to("Cancel", details_organisation_path(@organisation), secondary: true) %>