Ask Your Question
1

Exception 'taxonomist' unknown key

asked 2011-01-03 15:06:44 -0500

Benoit gravatar image

updated 2011-01-05 15:30:15 -0500

Evgeny gravatar image

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.

edit retag flag offensive 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 gravatar imageEvgeny ( 2011-01-03 15:30:49 -0500 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2011-01-03 19:48:19 -0500

Evgeny gravatar image

updated 2011-01-05 01:05:25 -0500

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.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2011-01-03 15:06:44 -0500

Seen: 89 times

Last updated: Jan 05 '11