diff options
author | RĂ©mi Duraffort <remi.duraffort@linaro.org> | 2018-07-17 12:01:51 +0200 |
---|---|---|
committer | Neil Williams <neil.williams@linaro.org> | 2018-07-17 13:03:21 +0000 |
commit | 664977da8d674bf8f66bc8406e603f02370317e1 (patch) | |
tree | a4e1eadce66f24dab75faf3837280a66bfaf4e42 | |
parent | 6383230a6327f6c3c9970522e9ed2adbdf2b921e (diff) |
Fix notification token after 1a13b85e
Bug found by meta-lava.
Change-Id: Idf9a079d2bea30914cc502023d9795abec397573
-rw-r--r-- | lava_scheduler_app/notifications.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lava_scheduler_app/notifications.py b/lava_scheduler_app/notifications.py index c615d60df..a16e19dda 100644 --- a/lava_scheduler_app/notifications.py +++ b/lava_scheduler_app/notifications.py @@ -45,10 +45,10 @@ from linaro_django_xmlrpc.models import AuthToken def get_token_from_description(user, description): - try: - return AuthToken.objects.filter(user=user, description=description).first() - except AuthToken.DoesNotExist: - return description + tokens = AuthToken.objects.filter(user=user, description=description) + if tokens: + return tokens.first().secret + return description def get_query_results(notification): |