diff --git a/changelog.d/7850.bugfix b/changelog.d/7850.bugfix
new file mode 100644
index 0000000000000000000000000000000000000000..5f19a890436fb341151957e8b6688a1359ebff33
--- /dev/null
+++ b/changelog.d/7850.bugfix
@@ -0,0 +1 @@
+Fix "AttributeError: 'str' object has no attribute 'get'" error message when applying per-room message retention policies. The bug was introduced in Synapse 1.7.0.
diff --git a/synapse/storage/data_stores/main/room.py b/synapse/storage/data_stores/main/room.py
index dace20e6dbd6016448e180fb3e760cf2caaedd2f..b4817d693f242f2d00d6308bab14e3ef971de730 100644
--- a/synapse/storage/data_stores/main/room.py
+++ b/synapse/storage/data_stores/main/room.py
@@ -916,7 +916,7 @@ class RoomBackgroundUpdateStore(SQLBaseStore):
                     retention_policy = {}
                 else:
                     ev = json.loads(row["json"])
-                    retention_policy = json.dumps(ev["content"])
+                    retention_policy = ev["content"]
 
                 self.db.simple_insert_txn(
                     txn=txn,