in client/securedrop_client/gui/widgets.py [0:0]
def reload(self) -> None:
"""
Updates the displayed values with the current values from self.source.
"""
# If the account or conversation is being deleted, do not update the source widget
if self.deleting or self.deleting_conversation:
return
# If the sync started before the deletion finished, then the sync is stale and we do
# not want to update the source widget.
if self.sync_started_timestamp < self.deletion_scheduled_timestamp:
return
try:
self.controller.session.refresh(self.source)
self.last_updated = self.source.last_updated
self.timestamp.setText(_(format_datetime_local(self.source.last_updated)))
self.name.setText(self.source.journalist_designation)
self.set_snippet(self.source_uuid)
if self.source.document_count == 0:
self.paperclip.hide()
self.paperclip_disabled.hide()
if not self.source.server_collection and self.source.interaction_count > 0:
self.preview.setProperty("class", "conversation_deleted")
else:
self.preview.setProperty("class", "")
self.star.update(self.source.is_starred)
self.end_deletion()
if self.source.document_count == 0:
self.paperclip.hide()
self.paperclip_disabled.hide()
self.star.update(self.source.is_starred)
# When not authenticated we always show the source as having been seen
self.seen = True if not self.controller.is_authenticated else self.source.seen
self.update_styles()
except sqlalchemy.exc.InvalidRequestError as e:
logger.debug(f"Could not update SourceWidget for source {self.source_uuid}: {e}")