First time here? Check out the FAQ!
1

Exception 'taxonomist' unknown key

In 0.6.17, I have a user with the "taxonomist" badge. Just migrated to 0.6.49 (or thereabout). When displaying the user, I get a KeyError exception (u'taxonomist' exception). The bottom of the stack has:

/ala-windanswer1/qa/wrqa_dev/askbot/models/repute.py in description
        return badges.get_badge(self.slug).description ...
▼ Local vars
Variable    Value
badges  <module 'askbot.models.badges' from '/ala-windanswer1/qa/wrqa_dev/askbot/models/badges.pyc'>
self   Error in formatting: u'taxonomist'  
/ala-windanswer1/qa/wrqa_dev/askbot/models/badges.py in get_badge
    return BADGES [key]() ...
▼ Local vars
Variable    Value
key u'taxonomist'
name    u'taxonomist'

Turns out there are a number of badges that have disapeared: Alpha, Beta, Expert, Stunk & White, Taxonomist, Yearling.

Looks like we need code to deal with badges that have been dropped so we don't get an exception.

Evgeny's avatar
13.2k
Evgeny
updated 2011-01-05 15:30:15 -0500
Benoit's avatar
875
Benoit
asked 2011-01-03 15:06:44 -0500
edit flag offensive 0 remove flag close merge delete

Comments

Thanks, I will create at least "Taxonomist" and "Expert" - in a couple of hours - at least in the stub form so that there are no exceptions like that. Stunk & White is renamed to "Associate Editor", alpha and beta I guess will be gone - will create a cleanup command.
Evgeny's avatar Evgeny (2011-01-03 15:30:49 -0500) edit
add a comment see more comments

1 Answer

0

Added two stub badges - Expert and Taxonomist. They are not yet awarded, but this error message should go away.

edit: Made taxonomist and commentator to work.

Either version 0.6.54 or this github commit have the fix.

Evgeny's avatar
13.2k
Evgeny
updated 2011-01-05 01:05:25 -0500, answered 2011-01-03 19:48:19 -0500
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments