2
0

Fix error on log-in from old users requiring ToS interstitial when said ToS has been removed (#35233)

This commit is contained in:
Claire
2025-07-01 19:43:59 +02:00
parent a203a05eb1
commit d7a08d81b6

View File

@@ -50,6 +50,13 @@ module WebAppControllerConcern
return unless current_user&.require_tos_interstitial?
@terms_of_service = TermsOfService.published.first
# Handle case where terms of service have been removed from the database
if @terms_of_service.nil?
current_user.update(require_tos_interstitial: false)
return
end
render 'terms_of_service_interstitial/show', layout: 'auth'
end