From f9ee8551f2c4e9bbbb7568c1194960c2b58cef36 Mon Sep 17 00:00:00 2001 From: James Rouzier Date: Tue, 21 Jan 2025 17:34:28 +0000 Subject: [PATCH] If login_remaining is an empty string treat it as NULL Fixes #8506 --- lib/pf/UnifiedApi/Controller/Users/Password.pm | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/pf/UnifiedApi/Controller/Users/Password.pm b/lib/pf/UnifiedApi/Controller/Users/Password.pm index 191f404ffcf9..89cb53b1f6ab 100644 --- a/lib/pf/UnifiedApi/Controller/Users/Password.pm +++ b/lib/pf/UnifiedApi/Controller/Users/Password.pm @@ -74,6 +74,13 @@ sub _handle_password_data { } } + if (exists $data->{login_remaining}) { + my $login_remaining = $data->{login_remaining}; + if (defined $login_remaining && $login_remaining eq '') { + $data->{login_remaining} = undef; + } + } + # Not sure why but currently in the cloudnac, the sponsor field breaks the insert # This is a temporary fix, we should figure out why this happens $data->{sponsor} = ($data->{sponsor} // "") ne "" ? $data->{sponsor} : 0;