Fix Patron logic in user detail page

This commit is contained in:
Alex Cabal 2024-12-01 17:01:18 -06:00
parent 9835e5cee0
commit 8cba20fbf5

View file

@ -64,7 +64,12 @@ class User{
if(!isset($this->_Patron)){ if(!isset($this->_Patron)){
try{ try{
$this->_Patron = Patron::Get($this->UserId); $this->_Patron = Patron::Get($this->UserId);
$this->IsPatron = true; if($this->_Patron->Ended === null){
$this->IsPatron = true;
}
else{
$this->IsPatron = false;
}
} }
catch(Exceptions\PatronNotFoundException){ catch(Exceptions\PatronNotFoundException){
$this->_Patron = null; $this->_Patron = null;