add badge_name_to_id utility function

This is a useful utility function that will enable us to resolve this problem: https://github.com/fedora-infra/tahrir/pull/286#discussion_r17325703