Re: [mezzanine-users] Sending an email to admins on new user profile creation

2017-02-08 Thread Christian Hill
This works fine – thank you very much, Stephen. (the import of ProfileForm is from mezzanine.accounts.forms, of course). It would be great if this sort of thing could be documented somewhere. Best wishes, Christian On 5 February 2017 at 23:51, Stephen McDonald wrote: > Just

Re: [mezzanine-users] Sending an email to admins on new user profile creation

2017-02-05 Thread Stephen McDonald
Just spent some time looking into this - there's actually a setting ACCOUNTS_PROFILE_FORM_CLASS ( http://mezzanine.jupo.org/docs/configuration.html#accounts-profile-form-class) which allows you to specify a custom form class for user profile signup/update. You could override the save method of it

Re: [mezzanine-users] Sending an email to admins on new user profile creation

2017-02-02 Thread Christian Hill
Unfortunately, I don't think this will work very reliably: the time of update and time of creation will be a little bit different, so I can't check for strict equality, but the two UserProfile save events occur close together, so I can't choose a reliable timedelta to ascertain whether the

Re: [mezzanine-users] Sending an email to admins on new user profile creation

2017-02-01 Thread Melvyn Sopacua
On Wednesday 01 February 2017 07:02:30 Christian Hill wrote: > And I don't want > the email sent if the user is simply editing their profile. > Would I be better off customizing the accounts app? Add two fields to your profile: * profile_created: DateTimeField(auto_now_add=True) *

Re: [mezzanine-users] Sending an email to admins on new user profile creation

2017-01-31 Thread Stephen McDonald
On Wed, Feb 1, 2017 at 8:46 AM, Christian Hill wrote: > Presumably UserProfile is saved twice and I'm only picking up the first > time, after it's been attached to a user but before the extra data is > attached to it. If that's true, then the signal handler would run each

[mezzanine-users] Sending an email to admins on new user profile creation

2017-01-31 Thread Christian Hill
Hello all, I'm trying to configure Mezzanine to send me an email when a new user signs up for an account on my site, and couldn't find anything in the docs about it, so I'm rolling my own by attaching a function to the post_save signal from my UserProfile model: @receiver(post_save,