dsmultimedika commited on
Commit
bf5c40f
·
1 Parent(s): 25f9481

improve user meta deletion

Browse files
Files changed (1) hide show
  1. db/query/query_user_meta.py +4 -2
db/query/query_user_meta.py CHANGED
@@ -80,8 +80,10 @@ class UserMetaQuery(BaseQuery):
80
 
81
  def delete_user_meta(self, db, metadata_id):
82
  """Delete user meta entries by metadata_id."""
83
- self.delete(db, model=User_Meta, id=metadata_id)
84
- return {"message": f"Book user with id {id} deleted successfully."}
 
 
85
 
86
  def delete_all_user_meta(self, db):
87
  """Delete all user meta entries for a user."""
 
80
 
81
  def delete_user_meta(self, db, metadata_id):
82
  """Delete user meta entries by metadata_id."""
83
+ filter_conditions = [User_Meta.metadata_id==metadata_id,
84
+ User_Meta.user_id==self.user_id]
85
+ self.delete(db, model=User_Meta, filter_conditions=filter_conditions)
86
+ return {"message": f"Book user with id {metadata_id} deleted successfully."}
87
 
88
  def delete_all_user_meta(self, db):
89
  """Delete all user meta entries for a user."""