Permalink
Browse files

Merge pull request #10 from skeet70/master

Fixes Issue #9
  • Loading branch information...
2 parents b7b09fd + aa82034 commit 7d69a061e3d37adbf805693624a8c8bbd43d4388 @paltman paltman committed Jul 10, 2013
Showing with 5 additions and 6 deletions.
  1. +0 −2 brabeion/base.py
  2. +3 −2 brabeion/internals.py
  3. +1 −1 docs/models.txt
  4. +1 −1 docs/usage.txt
View
@@ -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
@@ -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
@@ -3,7 +3,7 @@ Models in ``brabeion``
.. module:: brabeion.models
-.. class:: BadgeAwarded(models.Model)
+.. class:: BadgeAward(models.Model)
.. attribute:: user
View
@@ -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
-------------------

0 comments on commit 7d69a06

Please sign in to comment.