beta-nu-theta-chi / ox-dashboard

A chapter dashabord web app in Django for the Beta Nu Chapter of Theta Chi at Case Western Reserve University
MIT License
0 stars 0 forks source link

[Bug] Phone number entry does not display improper formatting correctly #64

Closed jcassarly closed 3 years ago

jcassarly commented 4 years ago

If a user enters a phone number in the wrong format, it takes you back to the editting page, but does not display an error message

For example

(555)-555-5555 wiill not work and not reasonable error message is displayed.

  1. The regex should maybe allow this pattern
  2. a proper error message should be displayed if the regex does not match
kihashi commented 4 years ago

In my experience, you're better off not validating the format of a phone number at all. There are a lot of corner cases, especially if you include international numbers.

On Sun, Oct 4, 2020, at 20:16, Jared Cassarly wrote:

If a user enters a phone number in the wrong format, it takes you back to the editting page, but does not display an error message

For example

(555)-555-5555 wiill not work and not reasonable error message is displayed.

  1. The regex should maybe allow this pattern
  2. a proper error message should be displayed if the regex does not match

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/beta-nu-theta-chi/ox-dashboard/issues/64, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAEU7QTY7XJD4VGFS6DAM43SJEF7BANCNFSM4SEBCXFA.

jcassarly commented 4 years ago

Seems fair, the regex was already there, so I didn't really see a reason to remove it. Thats probably a much easier solution too.

helper08 commented 3 years ago

This should have been resolved when I restored error messages for forms in the templates. The regex allows for up to 15 digits so international numbers should be okay. This leaves only the issue that you cannot include dashes in the phone number. I guess we can determine if that's a big enough deal that we should rewrite the validator? Honestly, as long as the error message is explicit enough that you have to only include integers I think it's fine.

jcassarly commented 3 years ago

I agree, go ahead and close this issue then

On Fri, Nov 20, 2020, 3:54 AM helper08 notifications@github.com wrote:

This should have been resolved when I restored error messages for forms in the templates. The regex allows for up to 15 digits so international numbers should be okay. This leaves only the issue that you cannot include dashes in the phone number. I guess we can determine if that's a big enough deal that we should rewrite the validator? Honestly, as long as the error message is explicit enough that you have to only include integers I think it's fine.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/beta-nu-theta-chi/ox-dashboard/issues/64#issuecomment-731034597, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFI4HGM3JPTZESWMSHJEZKDSQYVDFANCNFSM4SEBCXFA .