mirror of
https://git.sr.ht/~tsileo/microblog.pub
synced 2024-11-15 03:04:28 +00:00
Fix the migration
This commit is contained in:
parent
4e7fb005fa
commit
3bf77b2e82
1 changed files with 20 additions and 20 deletions
6
app.py
6
app.py
|
@ -464,8 +464,10 @@ def tmp_migrate():
|
||||||
@app.route("/migration1_step2")
|
@app.route("/migration1_step2")
|
||||||
@login_required
|
@login_required
|
||||||
def tmp_migrate2():
|
def tmp_migrate2():
|
||||||
|
# Remove buggy OStatus announce
|
||||||
|
DB.activities.remove({"activity.object": {"$regex": f"^tag:"}, "type": ActivityType.ANNOUNCE.value})
|
||||||
|
# Cache the object
|
||||||
for activity in DB.activities.find():
|
for activity in DB.activities.find():
|
||||||
try:
|
|
||||||
if (
|
if (
|
||||||
activity["box"] == Box.OUTBOX.value
|
activity["box"] == Box.OUTBOX.value
|
||||||
and activity["type"] == ActivityType.LIKE.value
|
and activity["type"] == ActivityType.LIKE.value
|
||||||
|
@ -483,8 +485,6 @@ def tmp_migrate2():
|
||||||
{"remote_id": announce.id},
|
{"remote_id": announce.id},
|
||||||
{"$set": {"meta.object": obj.to_dict(embed=True)}},
|
{"$set": {"meta.object": obj.to_dict(embed=True)}},
|
||||||
)
|
)
|
||||||
except Exception:
|
|
||||||
pass
|
|
||||||
return "Done"
|
return "Done"
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue