hello
the only thing you can do is compare dates of storage of the information
and then check if the current date is greater than the saved date is an
update

On Mon, Sep 17, 2018 at 10:08 AM 'dtdave' via Django users <
django-users@googlegroups.com> wrote:

> I have a Custom User Model and a separate Profile Model with django
> all-auth.
>
> The following signal creates the profile for the user and then informs the
> admin that a new user has registered.
>
> @receiver(post_save, sender=User)
> def create_user_profile(sender, **kwargs):
>     '''Create a profile for a new user'''
>     if kwargs['created']:
>         Profile.objects.create(user=kwargs['instance'])
>
>
> @receiver(post_save, sender=User)
> def notify_admin(sender, instance, created, **kwargs):
>     '''Notify the administrator that a new user has been added.'''
>     if created:
>         subject = 'New Registration created'
>         message = 'A new candidate  %s has registered with the site' %
> instance.email
>         from_addr = 'no-re...@example.com'
>         recipient_list = ('ad...@example.com',)
>         send_mail(subject, message, from_addr, recipient_list)
>
> This works fine and using Mailhog I get the email informing me of the new
> user.
>
> Where I am stuck, is that I also want to inform the admin when a profile
> is updated. However, for the life of me I cannot fathom out how to do this!
>
> Any help would be appreciated.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/fd387ab3-5993-4c54-b60b-7b16cf122c52%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/fd387ab3-5993-4c54-b60b-7b16cf122c52%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 
att.
Carlos Rocha

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAM-7rO29aQYomhgf6e7AM9sSBVvteUqgnj6uEC%2BHGwuVcQWn-Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to