Skip to content

Commit

Permalink
Listen to the correct events for password resets
Browse files Browse the repository at this point in the history
I missed this in recent changes to the ForgotPasswordController.
`h.accounts.subscribers` should listen to the correct events -- the
events from `h.accounts.events`, and not horus.
  • Loading branch information
nickstenning committed Jun 5, 2015
1 parent b09debd commit fa97d8a
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions h/accounts/subscribers.py
Expand Up @@ -9,20 +9,15 @@
from horus.events import (
NewRegistrationEvent,
RegistrationActivatedEvent,
PasswordResetEvent,
)

from .events import (
LoginEvent,
LogoutEvent,
)

from h.accounts import events
from h.stats import get_client as stats


@subscriber(LoginEvent)
@subscriber(events.LoginEvent)
@subscriber(NewRegistrationEvent, autologin=True)
@subscriber(PasswordResetEvent, autologin=True)
@subscriber(events.PasswordResetEvent, autologin=True)
@subscriber(RegistrationActivatedEvent)
def login(event):
request = event.request
Expand All @@ -39,7 +34,7 @@ def login(event):
request.response.headerlist.extend(headers)


@subscriber(LogoutEvent)
@subscriber(events.LogoutEvent)
def logout(event):
stats(event.request).get_counter('auth.local.logout').increment()

Expand All @@ -49,7 +44,7 @@ def new_registration(event):
stats(event.request).get_counter('auth.local.register').increment()


@subscriber(PasswordResetEvent)
@subscriber(events.PasswordResetEvent)
def password_reset(event):
stats(event.request).get_counter('auth.local.reset_password').increment()

Expand Down

0 comments on commit fa97d8a

Please sign in to comment.