mattjegan / django-gamification

The missing Django Gamification Package
Other
166 stars 28 forks source link

Add force_revoke() method to Badge #16

Closed mattjegan closed 6 years ago

mattjegan commented 6 years ago

Badge should implement a force_revoke() method that will make the badge no longer acquired. Though this could simply make acquired=False I think it might be better to add a revoked boolean field on to Badge that gets set to True when the method is called, since that way, we don't get in the way of point increments awarding badges.

This change would also mean that a user searching for acquired badges would probably use Badge.objects.filter(acquired=True, revoked=False) rather than Badge.objects.filter(acquired=True) since the latter would also return revoked badges. Does anyone see this as an issue? Would users be fine with this?

aljp commented 6 years ago

I'll take a look at this, I'm thinking a custom manager might be a good way to implement this?

mattjegan commented 6 years ago

Sounds good to me, looking forward to the PR 😄