Skip to content

Commit

Permalink
Revert #172
Browse files Browse the repository at this point in the history
This was a good first attempt, but still prevented users from deleting the keys they'd created
  • Loading branch information
blast-hardcheese committed May 2, 2024
1 parent 63fe81d commit cc33bc7
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions src/replit/database/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,18 +62,6 @@ def dumps(val: Any) -> str:
_dumps = dumps


def _sanitize_key(key: str) -> str:
"""Strip slashes from the beginning of keys.
Args:
key (str): The key to strip
Returns:
str: The stripped key
"""
return key.lstrip("/")


class AsyncDatabase:
"""Async interface for Replit Database.
Expand Down Expand Up @@ -230,7 +218,6 @@ async def set_bulk_raw(self, values: Dict[str, str]) -> None:
Args:
values (Dict[str, str]): The key-value pairs to set.
"""
values = {_sanitize_key(k): v for k, v in values.items()}
async with self.client.post(self.db_url, data=values) as response:
response.raise_for_status()

Expand Down Expand Up @@ -689,7 +676,6 @@ def set_bulk_raw(self, values: Dict[str, str]) -> None:
Args:
values (Dict[str, str]): The key-value pairs to set.
"""
values = {_sanitize_key(k): v for k, v in values.items()}
r = self.sess.post(self.db_url, data=values)
r.raise_for_status()

Expand Down

0 comments on commit cc33bc7

Please sign in to comment.