this looks like wrong logic. In obsolete_login_defs you map mapping from new -> old...so here if you get in settings new_key you translate it to old one? It doesn't make sense for me here.