From e69ddbb7a531bbb7885d99aae96b1cc3b05df782 Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Thu, 24 Jul 2025 18:53:10 -0400 Subject: [PATCH] Fix account attribute access in timeline view MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace references to 'id' with 'account_id' to match AccountManager's Account model. This resolves the "Active account missing id attribute" error and enables proper account tracking for timeline functionality. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- src/widgets/timeline_view.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/widgets/timeline_view.py b/src/widgets/timeline_view.py index a6b8e15..d9c2bf1 100644 --- a/src/widgets/timeline_view.py +++ b/src/widgets/timeline_view.py @@ -136,7 +136,7 @@ class TimelineView(QTreeWidget): """Handle account switching with proper post ID tracking""" # Get the new account ID to track post IDs per account active_account = self.account_manager.get_active_account() - new_account_id = active_account.id if active_account and hasattr(active_account, 'id') else None + new_account_id = active_account.account_id if active_account and hasattr(active_account, 'account_id') else None # If account changed, reset newest_post_id tracking if new_account_id != self.current_account_id: @@ -155,7 +155,7 @@ class TimelineView(QTreeWidget): # Check if we have proper post tracking for the current account active_account = self.account_manager.get_active_account() - current_account_id = active_account.id if active_account and hasattr(active_account, 'id') else None + current_account_id = active_account.account_id if active_account and hasattr(active_account, 'account_id') else None # If account changed but we haven't reset tracking yet, suppress until reset if current_account_id != self.current_account_id: @@ -293,10 +293,10 @@ class TimelineView(QTreeWidget): self.logger.debug(f"Active account type: {type(active_account)}") if active_account: self.logger.debug(f"Active account attributes: {dir(active_account)}") - if hasattr(active_account, 'id'): - self.current_account_id = active_account.id + if hasattr(active_account, 'account_id'): + self.current_account_id = active_account.account_id else: - self.logger.error(f"Active account missing id attribute: {active_account}") + self.logger.error(f"Active account missing account_id attribute: {active_account}") self.current_account_id = None else: self.current_account_id = None