summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Doan <andy.doan@linaro.org>2017-06-09 14:35:32 -0500
committerAndy Doan <andy.doan@linaro.org>2017-06-09 14:35:32 -0500
commitaafca4a75dbccdbbd51d39f36b4d1fbe52e8593c (patch)
treef32535b28b18c4b106397c959938db326fb6f4ca
parentb69f0d00fc037d91e840f313b2428b79779cc792 (diff)
downloadpatchwork-tools-aafca4a75dbccdbbd51d39f36b4d1fbe52e8593c.tar.gz
linaro-metrics: make logins case-insensitve
As seen with the Mark.Brown@linaro.org logins. This should make everything what is expected by Crowd and our code. Change-Id: I14734f420ad3eb55cb00c3a5eb5c223822d4002f
-rw-r--r--linaro_metrics/backends.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/linaro_metrics/backends.py b/linaro_metrics/backends.py
new file mode 100644
index 0000000..12b168c
--- /dev/null
+++ b/linaro_metrics/backends.py
@@ -0,0 +1,11 @@
+from crowdrest.backend import CrowdRestBackend
+
+
+class LowerCaseCrowdBackend(CrowdRestBackend):
+ def create_or_update_user(self, user_id):
+ return super(LowerCaseCrowdBackend, self).create_or_update_user(
+ user_id.lower())
+
+ def authenticate(self, username=None, password=None):
+ return super(LowerCaseCrowdBackend, self).authenticate(
+ username.lower(), password)