Use the same logic in both places to look up by slug-or-pid.

This follows on the earlier email: It might not be ther right way to address the problem at all.