whitmer / canvabadges

MIT License
29 stars 14 forks source link

Added student_id param when getting modules #10

Closed Kulgar closed 9 years ago

Kulgar commented 10 years ago

Hi Whitmer,

I'm offering you two fixes:

The image_urls bug happens when a badge is already awarded and someone change the image_url in the badge configuration. When someone performs this change, the already awarded badges are not updated. So when you call "badge.badge_url" on an already awarded badge, it sends back the path to the old image - behavior that we don't want.

As it really matter when a student wants to send his badge to backpack, I thought that we might check if badge_url is the same as the badge_config.settings["badge_url"] data, and if not, update it before sending the badge to backpack.

If we don't do this and we remove the old image, an error is thrown when sending to backpack.

whitmer commented 9 years ago

cherry-picked the important bits, thank you!