| Total Complexity | 5 |
| Total Lines | 17 |
| Duplicated Lines | 0 % |
| Coverage | 81.82% |
| Changes | 2 | ||
| Bugs | 0 | Features | 1 |
| 1 | 1 | from django.conf import settings |
|
| 5 | 1 | class LocalizedIntegerField(LocalizedField): |
|
| 6 | |||
| 7 | 1 | @classmethod |
|
| 8 | def from_db_value(cls, value, *_): |
||
| 9 | |||
| 10 | 1 | if isinstance(value, dict): |
|
| 11 | 1 | values = LocalizedField.from_db_value(value, *_) |
|
| 12 | 1 | converted_values = {} |
|
| 13 | |||
| 14 | 1 | for lang_code, _ in settings.LANGUAGES: |
|
| 15 | 1 | value = values.get(lang_code) |
|
| 16 | 1 | converted_values[lang_code] = int(value) if value is not None else None |
|
| 17 | |||
| 18 | 1 | return cls.attr_class(converted_values) |
|
| 19 | |||
| 20 | if not isinstance(value, dict): |
||
| 21 | return int(value) |
||
| 22 |
This can be caused by one of the following:
1. Missing Dependencies
This error could indicate a configuration issue of Pylint. Make sure that your libraries are available by adding the necessary commands.
2. Missing __init__.py files
This error could also result from missing
__init__.pyfiles in your module folders. Make sure that you place one file in each sub-folder.