Removed the unused __entry pseudo property from the JournalEntryForm form.
This commit is contained in:
parent
08d1e60238
commit
56045f0faf
@ -344,26 +344,6 @@ class JournalEntryForm(FlaskForm):
|
||||
return None if self.__original_entry is None \
|
||||
else str(self.__original_entry)
|
||||
|
||||
@property
|
||||
def __entry(self) -> JournalEntry | None:
|
||||
"""Returns the journal entry.
|
||||
|
||||
:return: The journal entry.
|
||||
"""
|
||||
if not hasattr(self, "____entry"):
|
||||
def get_entry() -> JournalEntry | None:
|
||||
if self.eid.data is None:
|
||||
return None
|
||||
return JournalEntry.query\
|
||||
.filter(JournalEntry.id == self.eid.data)\
|
||||
.options(selectinload(JournalEntry.transaction),
|
||||
selectinload(JournalEntry.account),
|
||||
selectinload(JournalEntry.offsets)
|
||||
.selectinload(JournalEntry.transaction))\
|
||||
.first()
|
||||
setattr(self, "____entry", get_entry())
|
||||
return getattr(self, "____entry")
|
||||
|
||||
@property
|
||||
def is_original_entry(self) -> bool:
|
||||
"""Returns whether the entry is an original entry.
|
||||
|
Loading…
Reference in New Issue
Block a user