proper checking of max_obbjects_exceeded

This commit is contained in:
hjoaquim
2024-05-10 11:41:35 +01:00
parent b960c16c81
commit 03915f8d8e
2 changed files with 8 additions and 6 deletions

View File

@@ -158,11 +158,7 @@ class PlatformController(BaseController):
title = f"{self.PATH}{translator.func.__name__}"
if obbject:
max_obbjects_exceeded = (
len(session.obbject_registry.obbjects)
>= session.settings.N_TO_KEEP_OBBJECT_REGISTRY
)
if max_obbjects_exceeded:
if session.max_obbjects_exceeded():
session.obbject_registry.remove()
# use the obbject to store the command so we can display it later on results
@@ -214,7 +210,7 @@ class PlatformController(BaseController):
figure=fig,
)
if max_obbjects_exceeded:
if session.max_obbjects_exceeded():
session.console.print(
"[yellow]\nMaximum number of OBBjects reached. The oldest entry was removed.[yellow]"
)