diff options
| author | Alassane Yattara <alassane.yattara@savoirfairelinux.com> | 2023-10-17 21:32:05 +0100 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-10-23 11:46:36 +0100 |
| commit | b879dc5d9ab96798304742bb2de381ed71cb20a4 (patch) | |
| tree | bcdd2666c4fd02ff32fdf323a961def19a67f7d6 /bitbake | |
| parent | 3daf36c62911789ceaa651c85747b8bf031ed794 (diff) | |
| download | poky-b879dc5d9ab96798304742bb2de381ed71cb20a4.tar.gz | |
bitbake: Toaster: bug-fix on /toastermain/logs.py
- Update /toastermain/logs.py to fix:
AttributeError: 'NoneType' object has no attribute 'view_name'
Signed-off-by Alassane Yattara <alassane.yattara@savoirfairelinux.com>
(Bitbake rev: 307f40fc83a0e3d530bf934ef4aefd8e15cf27de)
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
| -rw-r--r-- | bitbake/lib/toaster/toastermain/logs.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/bitbake/lib/toaster/toastermain/logs.py b/bitbake/lib/toaster/toastermain/logs.py index f9953982b7..b4910e4432 100644 --- a/bitbake/lib/toaster/toastermain/logs.py +++ b/bitbake/lib/toaster/toastermain/logs.py | |||
| @@ -38,8 +38,13 @@ def log_view_mixin(view): | |||
| 38 | request = kwargs.get('request') | 38 | request = kwargs.get('request') |
| 39 | 39 | ||
| 40 | response = view(*args, **kwargs) | 40 | response = view(*args, **kwargs) |
| 41 | view_name = 'unknown' | ||
| 42 | if hasattr(request, 'resolver_match'): | ||
| 43 | if hasattr(request.resolver_match, 'view_name'): | ||
| 44 | view_name = request.resolver_match.view_name | ||
| 45 | |||
| 41 | log_api_request( | 46 | log_api_request( |
| 42 | request, response, request.resolver_match.view_name, 'toaster') | 47 | request, response, view_name, 'toaster') |
| 43 | return response | 48 | return response |
| 44 | return log_view_request | 49 | return log_view_request |
| 45 | 50 | ||
