Giter VIP home page Giter VIP logo

Comments (9)

willingc avatar willingc commented on September 21, 2024

@Nerdylicious @rosariorobinson @tapasweni-pathak Please add any history on what is the unique user identification parameter or the desired unique identifier.

@jayesh92, @vubo My understanding is the project uses django.contrib.auth.models User objects.

django.contrib.auth.models uses username as a required identifier unless overridden as a custom user model.
https://docs.djangoproject.com/en/1.8/topics/auth/default/
https://docs.djangoproject.com/en/1.8/ref/contrib/auth/#django.contrib.auth.models.User

Overall, it probably makes sense for this to have better documentation of the model:
https://github.com/systers/vms/blob/0190b907673f638c21ef3bc1673bfcc3c1a4735e/vms/volunteer/models.py#L102

from vms.

tapaswenipathak avatar tapaswenipathak commented on September 21, 2024

@willingc Yes, as the project uses django.contrib.auth.models, the unique identifier is username.

I don't feel it should be like this, every user of vms (volunteers) should have a unique username and email id. Later, if we added some features which uses the uniqueness, it may create a problem.
Once someone registered with a email id and a username, the email id should not be allowed to used again.

@rosariorobinson @Nerdylicious can suggest better.

from vms.

willingc avatar willingc commented on September 21, 2024

@tapasweni-pathak While the email can be checked and set as unique, I don't believe that it should be the primary ID of uniqueness for a volunteer. Many people have multiple email addresses and down the road the volunteer management system may have to support a user's multiple contact preferences.

I think it is best to use the django default of username as the unique identifier since core Django can take care of much of the user checking without having to write our own.

There should be a check that an email can not be committed to the database if any other user has that email in the database.

from vms.

tapaswenipathak avatar tapaswenipathak commented on September 21, 2024

@willingc I think I was not able to explain myself properly.

While the uniqueness check should be on the username but the email id should not be allowed to be reused again for some other username. The same thing that you are saying. 👍

What I meant with adding some features using this is, if someday we wanted to support search for a volunteer using her/his mail id. One mail id should reference one username and a user can ofcourse have multiple mail ids. From mail id to username, it should be M:1 relationship and M >= 1.

Once someone registered with a email id and a username, the email id should not be allowed to used again. That's why I said it should not be like this, we should have one check on the reuse (not allowed) of email id for different username.

from vms.

willingc avatar willingc commented on September 21, 2024

@tapasweni-pathak 👍 Yes, we are in agreement. Sorry I didn't understand this from the earlier comment 🍰

from vms.

tapaswenipathak avatar tapaswenipathak commented on September 21, 2024

@willingc 🌟

from vms.

shebytesit avatar shebytesit commented on September 21, 2024

Definitely a data model error to allow the same email address for multiple usernames (IMO). I have been on a project in the past where they changed the unique identifier from user id to email addresses to address issues that arose.

from vms.

vubo avatar vubo commented on September 21, 2024

@jayesh92 thanks for opening an issue.

@willingc @tapasweni-pathak @galarnyk thank you for the discussion and help. I added unique=True to the email field in the PR #84

from vms.

tapaswenipathak avatar tapaswenipathak commented on September 21, 2024

I think, now this issue can we closed.

from vms.

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.