def METHOD_NAME(v, aid):
	app = g.db.query(OauthApp).filter_by(id=aid).one_or_none()
	if app:
		for auth in g.db.query(ClientAuth).filter_by(oauth_client=app.id).all(): g.db.delete(auth)
		send_repeatable_notification(app.author.id, f"@{v.username} has rejected your application `{app.app_name}`.")
		g.db.delete(app)
		ma = ModAction(
			kind="reject_app",
			user_id=v.id,
			target_user_id=app.author.id,
		)
		g.db.add(ma)
		g.db.commit()
	return {"message": "App rejected"}