Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validation Rule for notification_email_address #21

Open
gvee-uk opened this issue Jun 23, 2022 · 1 comment
Open

Validation Rule for notification_email_address #21

gvee-uk opened this issue Jun 23, 2022 · 1 comment

Comments

@gvee-uk
Copy link
Contributor

gvee-uk commented Jun 23, 2022

notification_email_address is a bit of a weird one.

The value is never sanity checked by SQL Server when used, and it silently truncates it to a maximum of 100 characters, leading to some unwanted side effects such as malformed email address(es)!

Technically speaking this can use a semi-colon delimited list of addresses, so long as the total length is less than 100 characters. However it is more commonly used for a single email address value (hence the name being a singleton).

As a minimum I want it to be validated such that:

  • An exception is thrown if the value is longer than 100 characters

Nice to haves:

  • Throw an exception if the string is too short
  • Throw an exception if the value (or values if semi-colon delimited) don't look like valid email addresses (which might trump the previous rule)
@gvee-uk
Copy link
Contributor Author

gvee-uk commented Jun 24, 2022

If we move to pydqntic the length check should be easily achievable using constr which has min_length and max_length options.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant