Code Monkey home page Code Monkey logo

django-multimail's People

Contributors

besbes avatar clemente avatar hkarpf avatar scott2b avatar volrath avatar ysvg1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

django-multimail's Issues

Integrity error when adding e-mail that belongs to another user

class EmailAddress(models.Model):
…
    email = models.EmailField(max_length=100, unique=True)

But then:

            try:
                addr = EmailAddress.objects.get(user=user,email=user.email)
                # Provides that an address that has been just verified
                # without use of django-multimail, is still considered
                # verified in conditions of django-multimail
                if user.is_active and not addr.verified_at:
                    addr.verified_at = now()
            except EmailAddress.DoesNotExist:
                addr = EmailAddress()
                addr.user = user
                addr.email = user.email
            addr.save(verify=False)

The search you do is for user X and e-mail Y. If there's user Z with e-mail Y, you find 0 results, then you try to add (X,Y) which fails due to uniqueness (Y already exists).
I think: before creating a new one (X,Y), you should .filter(email=user.email) to see whether that e-mail (*,Y) already exists.
Just before the code I posted there's another piece of code that needs the same change.

Handler doesn't get called with post_save (problem with signals)

try:
USER_MODEL = settings.AUTH_USER_MODEL
except AttributeError: # handle Django 1.4
from django.contrib.auth.models import User
USER_MODEL = User

The signals of post_save don't get called when I leave this settings as is (inside models.py)

Though if I delete it all and use only this:
from django.contrib.auth.models import User
USER_MODEL = User

Then, the post_save signal gets caught and the mail_handler works.

I don't understand why is this happening..
Thanks a lot for your help!

Deprecation error moving forward

/usr/local/lib/virt_env/lib/python2.7/site-packages/multimail/models.py:27: RemovedInDjango19Warning: Model class multimail.models.EmailAddress doesn't declare an explicit app_label and either isn't in an application in INSTALLED_APPS or else was imported before its application was loaded. This will no longer be supported in Django 1.9.
  class EmailAddress(models.Model):

This ticket explains some of the issue, simple fix, just need to put an app label on the EmailAddress model, will submit a merge request in a bit.
https://code.djangoproject.com/ticket/21719

Is it dead?

Is this project dead or not? I didn't found any other solution for this problem. And I wasn't able to get this on Django 1.11. I'm getting exception "Apps aren't loaded yet." when multimail is importing django.contrib.sites.model in util.py file on line 2.

Any idea? Any similar project for newer version of Django?

Implement option to not allow user to change primary email address

I'm using this in a project where we assign users an initial account and do not want to allow them to change their primary address. I'm going to submit a merge request with a feature that would disallow that, e.g. an option of MM_DISABLE_CHANGE_PRIMARY_ADDRESS.

Sending mail to admins

Hi,

Great work on a really useful Django package.

I have one request really and that is to make the sending of emails to admins optional via the settings file. I find myself creating users and modifying them in the backend and constantly receiving emails.

Other than that, thanks for the great work!

Cheers,
Aksel

EmailAddress should be unique

Currently, an EmailAddress is unique_together with the user associated with the address. I don't recall the use case for taking this approach. It seems like it would be better for email addresses to be unique overall.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.