Skip to content

Fixes Issue #9 #10

Merged
merged 2 commits into from Jul 10, 2013
View
2 brabeion/base.py
@@ -46,8 +46,6 @@ def actually_possibly_award(self, **state):
awarded = self.award(**state)
if awarded is None:
return
- if awarded.user is not None:
- user = awarded.user
if awarded.level is None:
assert len(self.levels) == 1
awarded.level = 1
View
5 brabeion/internals.py
@@ -26,8 +26,9 @@ def register(self, badge):
self._event_registry.setdefault(event, []).append(badge)
def possibly_award_badge(self, event, **state):
- for badge in self._event_registry[event]:
- badge.possibly_award(**state)
+ if event in self._event_registry:
+ for badge in self._event_registry[event]:
+ badge.possibly_award(**state)
badges = BadgeCache()
View
2 docs/models.txt
@@ -3,7 +3,7 @@ Models in ``brabeion``
.. module:: brabeion.models
-.. class:: BadgeAwarded(models.Model)
+.. class:: BadgeAward(models.Model)
.. attribute:: user
View
2 docs/usage.txt
@@ -100,7 +100,7 @@ to the user:
By default badges will be awarded at the current time, if you need to overide
the award time of the badge you can pass a ``force_timestamp`` keyword argument
-to ``possible_award_badge()``.
+to ``possibly_award_badge()``.
Asynchronous Badges
-------------------
Something went wrong with that request. Please try again.