summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Dauvergne <bdauvergne@entrouvert.com>2018-09-27 13:51:13 (GMT)
committerBenjamin Dauvergne <bdauvergne@entrouvert.com>2018-09-27 13:51:13 (GMT)
commit9781d9e401d84241321123e562e926cf361f75e2 (patch)
treebf94eaa39ad616fbefbc78b886fbded62af5981d
parent2bf3349fe51b9ef558a160b68e9c068ddfc416c8 (diff)
downloadauthentic2-cut-9781d9e401d84241321123e562e926cf361f75e2.zip
authentic2-cut-9781d9e401d84241321123e562e926cf361f75e2.tar.gz
authentic2-cut-9781d9e401d84241321123e562e926cf361f75e2.tar.bz2
prevent empty email on API user creation (fixes #26768)
-rw-r--r--src/authentic2_cut/apps.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/authentic2_cut/apps.py b/src/authentic2_cut/apps.py
index e593e83..1f09a78 100644
--- a/src/authentic2_cut/apps.py
+++ b/src/authentic2_cut/apps.py
@@ -255,6 +255,7 @@ class AppConfig(django.apps.AppConfig):
# forbid modification of email trough POST/PATCH/PUT
if serializer.instance:
serializer.fields['email'].read_only = True
+ serializer.fields['email'].required = True
serializer.fields['email_verified'].read_only = True
serializer.fields['ou'].write_only = True
serializer.fields['ou'].read_only = True