Skip to content

Commit

Permalink
facilities fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
saladgg committed Jan 11, 2022
1 parent c4adf48 commit ef8b079
Show file tree
Hide file tree
Showing 15 changed files with 5,952 additions and 5,504 deletions.
2 changes: 1 addition & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[run]
branch=True
source=fahari
omit=fahari/config/*,fahari/**/migrations/*,scripts/*,fahari/**/tests/*
omit=fahari/config/*,fahari/**/migrations/*,scripts/*,fahari/**/tests/*,fahari/sims/*

[report]
exclude_lines =
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ jobs:
- name: mypy
run: |
sudo apt-get update && sudo apt-get upgrade
mypy .
pytest:
Expand Down Expand Up @@ -105,6 +106,7 @@ jobs:
- name: Set up Django
run: |
sudo apt-get update && sudo apt-get upgrade
python manage.py migrate
python manage.py createcachetable
python manage.py collectstatic --noinput
Expand Down
Binary file modified data/all_mfl_facilities.xlsx
Binary file not shown.
Binary file modified data/updated_fyj_facilities.xlsx
Binary file not shown.
1 change: 1 addition & 0 deletions fahari/common/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"Mowlem",
"Umoja I",
"Umoja II",
"Utawala",
),
"Kamukunji": (
"Airbase",
Expand Down
2 changes: 1 addition & 1 deletion fahari/common/tests/test_administrative_unit_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def test_get_wards():
assert ("Ziwani/Kariokor", "Ziwani/Kariokor") in wards
assert ("Landimawe", "Landimawe") in wards
assert ("Nairobi South", "Nairobi South") in wards
assert len(wards) == 109
assert len(wards) == 110


def test_get_wards_for_sub_county_with_missing_sub_county():
Expand Down
2 changes: 1 addition & 1 deletion fahari/common/views/mixins/drf_mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def get_excel_io(self, **kwargs) -> EIO:
excel_io_class = self.get_excel_io_class()
default_kwargs = self.get_excel_io_kwargs()
default_kwargs.update(kwargs)
return excel_io_class(**default_kwargs) # type: ignore
return excel_io_class(**default_kwargs)

def get_excel_io_kwargs(self) -> Dict[str, Any]:
"""Return kwargs to be used when initializing an excel io instance."""
Expand Down
2 changes: 1 addition & 1 deletion fahari/misc/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ class ProcessGoogleSheetRowError(RuntimeError):
def __init__(self, row: Sequence[str], row_index: int, *args, **kwargs):
self.row: Sequence[str] = tuple(row)
self.row_index: int = row_index
super().__init__(*args, **kwargs) # type: ignore
super().__init__(*args, **kwargs)
4 changes: 0 additions & 4 deletions fahari/sims/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -846,10 +846,6 @@ def questions(self) -> QuestionQuerySet:

return Question.objects.for_questionnaire(questionnaire=self.questionnaire)

@property
def mentors(self):
return self.metadata["mentors"]

def get_absolute_url(self):
is_complete = bool(self.finish_date is not None)
if is_complete:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ <h5>Mentors list</h5>
<th>Organisation</th>
</thead>
<tbody>
{%for mentor in object.mentors%}
{%for mentor in object.metadata.mentors%}
<tr>
<td>{{forloop.counter}}.</td>
<td>{{mentor.name}}</td>
Expand Down
2 changes: 1 addition & 1 deletion fahari/utils/excel_utils/drf_serializer_excel_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def get_template(self, *args, **kwargs) -> T:
self.get_fields(), self.get_nested_entries_delimiter()
)

return template_class(*args, **kwargs) # type: ignore
return template_class(*args, **kwargs)

def get_template_class(self) -> Type[T]:
"""Return a class to use for the template. Defaults to using `self.template_class`."""
Expand Down
Loading

0 comments on commit ef8b079

Please sign in to comment.