Skip to content

Commit

Permalink
Use model_dump_json() instead of deprecated json()
Browse files Browse the repository at this point in the history
  • Loading branch information
jdavcs committed Apr 2, 2024
1 parent ab299a3 commit f7f91a7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/galaxy/managers/export_tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def set_export_association_metadata(self, export_association_id: int, export_met
export_association: StoreExportAssociation = self.session.execute(stmt).scalars().one()
except NoResultFound:
raise ObjectNotFound("Cannot set export metadata. Reason: Export association not found")
export_association.export_metadata = export_metadata.json() # type:ignore[assignment]
export_association.export_metadata = export_metadata.model_dump_json() # type:ignore[assignment]
with transaction(self.session):
self.session.commit()

Expand Down
4 changes: 3 additions & 1 deletion lib/galaxy/managers/notification.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,9 @@ def update_user_notification_preferences(
"""Updates the user's notification preferences with the requested changes."""
notification_preferences = self.get_user_notification_preferences(user)
notification_preferences.update(request.preferences)
user.preferences[NOTIFICATION_PREFERENCES_SECTION_NAME] = notification_preferences.json() # type:ignore[index]
user.preferences[NOTIFICATION_PREFERENCES_SECTION_NAME] = (
notification_preferences.model_dump_json()
) # type:ignore[index]
with transaction(self.sa_session):
self.sa_session.commit()
return notification_preferences
Expand Down

0 comments on commit f7f91a7

Please sign in to comment.