|
41 | 41 |
|
42 | 42 | # TODO: delete this after finish testing
|
43 | 43 | # pylint: disable=wrong-import-position, wrong-import-order,ungrouped-imports
|
44 |
| -import logging |
45 |
| - |
46 | 44 | from codeforlife.views import HealthCheckView as _HealthCheckView
|
| 45 | +from codeforlife.views.health_check import HealthCheck |
47 | 46 | from django.conf import settings
|
48 | 47 |
|
49 | 48 |
|
50 | 49 | # pylint: disable-next=missing-class-docstring
|
51 | 50 | class HealthCheckView(_HealthCheckView):
|
52 | 51 | def get_health_check(self, request):
|
53 |
| - # pylint: disable-next=logging-fstring-interpolation |
54 |
| - logging.warning( |
55 |
| - f"STATIC_ROOT: {settings.STATIC_ROOT}." |
56 |
| - f" STATIC_URL: {settings.STATIC_URL}." |
57 |
| - f" AWS_STORAGE_BUCKET_NAME: {settings.AWS_STORAGE_BUCKET_NAME}." |
| 52 | + health_check = super().get_health_check(request) |
| 53 | + return HealthCheck( |
| 54 | + health_status=health_check.health_status, |
| 55 | + additional_info=health_check.additional_info, |
| 56 | + details=[ |
| 57 | + HealthCheck.Detail( |
| 58 | + name="STATIC_ROOT", |
| 59 | + description=str(settings.STATIC_ROOT), |
| 60 | + health="healthy", |
| 61 | + ), |
| 62 | + HealthCheck.Detail( |
| 63 | + name="STATIC_URL", |
| 64 | + description=str(settings.STATIC_URL), |
| 65 | + health="healthy", |
| 66 | + ), |
| 67 | + HealthCheck.Detail( |
| 68 | + name="AWS_STORAGE_BUCKET_NAME", |
| 69 | + description=str(settings.AWS_STORAGE_BUCKET_NAME), |
| 70 | + health="healthy", |
| 71 | + ), |
| 72 | + HealthCheck.Detail( |
| 73 | + name="AWS_S3_CUSTOM_DOMAIN", |
| 74 | + description=str(settings.AWS_S3_CUSTOM_DOMAIN), |
| 75 | + health="healthy", |
| 76 | + ), |
| 77 | + HealthCheck.Detail( |
| 78 | + name="AWS_LOCATION", |
| 79 | + description=str(settings.AWS_LOCATION), |
| 80 | + health="healthy", |
| 81 | + ), |
| 82 | + HealthCheck.Detail( |
| 83 | + name="AWS_DEFAULT_ACL", |
| 84 | + description=str(settings.AWS_DEFAULT_ACL), |
| 85 | + health="healthy", |
| 86 | + ), |
| 87 | + HealthCheck.Detail( |
| 88 | + name="AWS_S3_ADDRESSING_STYLE", |
| 89 | + description=str(settings.AWS_S3_ADDRESSING_STYLE), |
| 90 | + health="healthy", |
| 91 | + ), |
| 92 | + HealthCheck.Detail( |
| 93 | + name="AWS_S3_REGION_NAME", |
| 94 | + description=str(settings.AWS_S3_REGION_NAME), |
| 95 | + health="healthy", |
| 96 | + ), |
| 97 | + ], |
58 | 98 | )
|
59 |
| - return super().get_health_check(request) |
60 | 99 |
|
61 | 100 |
|
62 | 101 | urlpatterns = get_urlpatterns(
|
|
0 commit comments