Coder Social home page Coder Social logo

Comments (4)

uhurusurfa avatar uhurusurfa commented on June 14, 2024

The right route to go will depend on whether it makes sense to have multiple users records with the same email address.
Since the email address has not been unique till now it is likely to be a breaking change if we now make it unique and so would have to justify it.
Many of the login recovery plugins rely on a unique email address (for the most part across all apps these days you are requested to enter an email address for recovery). The logical approach is to make the email address unique and the path I would support. Modern email servers allow the use of a + sign in the email name part and ignores everything from the + onwards for delivering the email to the right inbox allowing people to use the same email address for multiple user accounts. All of the below would deliver to the same inbox:
[email protected]
[email protected]
[email protected]

If we made the email address unique then we could provide an upgrade script that searches for and modifies the 2nd and subsequent duplicate email addresses with a numeric number something like below:
[email protected]
[email protected]
[email protected]

from django-helpdesk.

brucegibbins avatar brucegibbins commented on June 14, 2024

Would making the email address unique be limited to the HelpDesk App? I guess so, and would that then mean having a customised auth.user?

from django-helpdesk.

uhurusurfa avatar uhurusurfa commented on June 14, 2024

Unfortunately it would affect all other apps within the same Django project since they all must use the same User object for authentication to work.
The least disruptive route is to change the query to fetch all active user records (|the current query fails to omit inactive reccords) and if there is more than 1 then pick the first one and log a warning that there are multiple users with the same email address.

That may have undesirable consequences in that the user would have to be logged in against the user record that was first in the list to see it. Otherwise it relies on sending an email to that email address and the user will have to figure which account to login as to see it.

The only other way is to simply log an error message if there is more than 1 user recrod matching the email and not add any tocket for it.

from django-helpdesk.

uhurusurfa avatar uhurusurfa commented on June 14, 2024

Perhaps the simplest option is to add a hook into the save signal on the user model and check for duplicated email addresses manually. We could log a warning to the log system that it has consequences and then at least the issue is notified. We could send an email to the user when it is detected.
Because this is developed as a plugin app, there is no easy way to nofity a user via the UI that they may experience problems using multiple accounts wit hthe same email address.

from django-helpdesk.

Related Issues (20)

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.