Uploaded image for project: 'OpenMRS Core'
  1. OpenMRS Core
  2. TRUNK-6059

UserValidator should ensure that email is unique

    XMLWordPrintable

Details

    • Enhancement
    • Status: Closed
    • Should
    • Resolution: Fixed
    • None
    • Core 2.6.0
    • None
    • None
    • Low

    Description

      In OpenMRS 2.2, a new "email" property was added to User. In the database, this is setup as a unique field on the users table. See:

      https://github.com/openmrs/openmrs-core/blob/master/api/src/main/resources/org/openmrs/liquibase/updates/liquibase-update-to-latest-2.2.x.xml#L372

      However, there is no corresponding validation of this in the UserValidator. This results in error messages similar to: Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry 'test@test.com' for key 'email', rather than an actual validation exception.

      Either the unique constraint should be removed from the users table, or additional validation should be added to the UserValidator to enforce it prior to saving.

      Gliffy Diagrams

        Attachments

          Activity

            People

              mseaton Mike Seaton
              mseaton Mike Seaton
              Daniel Kayiwa Daniel Kayiwa
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: