Files @ ecabf31e54b9
Branch filter:

Location: symposion_app/pinaxcon/receivers.py

Christopher Neugebauer
Assorted fixes (#47)

* Invokes the site tree fix from previous fixes.

* Adds a disclaimer noting that previous years’ accounts have not been carried over.

Fixes #43

* Adds proposal type to the proposal summary page.

Fixes #40

* Adds travel/accommodation assistance to the proposals page, but makes it only visible to speakers in the proposal, or review managers.

Fixes #41.
Fixes #42.

* Reduces a lot of the whitespace in the header and footer.

Fixes #44

* Proposals review page now shows information for every speaker on a proposal.

Fixes #45

* Makes sure that non_field_errors are displayed by forms.

Fixes #37
from django.dispatch import receiver

from account.signals import password_changed
from account.signals import user_sign_up_attempt, user_signed_up
from account.signals import user_login_attempt, user_logged_in

from pinax.eventlog.models import log


@receiver(user_logged_in)
def handle_user_logged_in(sender, **kwargs):
    log(
        user=kwargs.get("user"),
        action="USER_LOGGED_IN",
        extra={}
    )


@receiver(password_changed)
def handle_password_changed(sender, **kwargs):
    log(
        user=kwargs.get("user"),
        action="PASSWORD_CHANGED",
        extra={}
    )


@receiver(user_login_attempt)
def handle_user_login_attempt(sender, **kwargs):
    log(
        user=None,
        action="LOGIN_ATTEMPTED",
        extra={
            "username": kwargs.get("username"),
            "result": kwargs.get("result")
        }
    )


@receiver(user_sign_up_attempt)
def handle_user_sign_up_attempt(sender, **kwargs):
    log(
        user=None,
        action="SIGNUP_ATTEMPTED",
        extra={
            "username": kwargs.get("username"),
            "email": kwargs.get("email"),
            "result": kwargs.get("result")
        }
    )


@receiver(user_signed_up)
def handle_user_signed_up(sender, **kwargs):
    log(
        user=kwargs.get("user"),
        action="USER_SIGNED_UP",
        extra={}
    )