mirror of
				https://git.sr.ht/~tsileo/microblog.pub
				synced 2025-06-05 21:59:23 +02:00 
			
		
		
		
	Tweak remote actor deletion
This commit is contained in:
		| @@ -178,11 +178,12 @@ async def fetch_actor( | ||||
|         await db_session.scalars( | ||||
|             select(models.Actor).where( | ||||
|                 models.Actor.ap_id == actor_id, | ||||
|                 models.Actor.is_deleted.is_(False), | ||||
|             ) | ||||
|         ) | ||||
|     ).one_or_none() | ||||
|     if existing_actor: | ||||
|         if existing_actor.is_deleted: | ||||
|             raise ap.ObjectNotFoundError(f"{actor_id} was deleted") | ||||
|         return existing_actor | ||||
|     else: | ||||
|         if save_if_not_found: | ||||
|   | ||||
| @@ -1735,6 +1735,8 @@ async def save_to_inbox( | ||||
| ) -> None: | ||||
|     try: | ||||
|         actor = await fetch_actor(db_session, ap.get_id(raw_object["actor"])) | ||||
|     except ap.ObjectNotFoundError: | ||||
|         logger.warning("Actor not found") | ||||
|     except httpx.HTTPStatusError: | ||||
|         logger.exception("Failed to fetch actor") | ||||
|         return | ||||
|   | ||||
		Reference in New Issue
	
	Block a user