Skip to content

Commit

Permalink
Merge pull request #2415 from unicef/staging
Browse files Browse the repository at this point in the history
Staging
  • Loading branch information
domdinicola authored Jul 3, 2019
2 parents da04d4a + 636a98e commit e9c64a2
Show file tree
Hide file tree
Showing 45 changed files with 1,114 additions and 454 deletions.
3 changes: 2 additions & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ tox = "*"
drf-api-checker = "*"
factory-boy = ">=2.11"
sphinx = "*"
vcrpy = "*"

[packages]
azure-storage = "==0.20.2"
Expand Down Expand Up @@ -70,7 +71,7 @@ social-auth-app-django = "==3.1"
social-auth-core = {extras = ["azuread"],version = "==3.1"}
tenant-schemas-celery = "==0.2.1"
unicef_attachments = "==0.5.1"
unicef-djangolib = "==0.5.2"
unicef-djangolib = "==0.5.3"
unicef-locations = "==1.7"
unicef_notification = "==0.2.1"
unicef_restlib = "==0.4"
Expand Down
419 changes: 254 additions & 165 deletions Pipfile.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion runtests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ fi
coverage erase
time coverage run manage.py test --noinput --keepdb "$@"
coverage report -m

coverage html
2 changes: 1 addition & 1 deletion src/etools/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
VERSION = __version__ = '7.0.1'
VERSION = __version__ = '7.1'
NAME = 'eTools'
4 changes: 2 additions & 2 deletions src/etools/applications/action_points/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
app_name = 'action-points'

action_points_api = routers.SimpleRouter()
action_points_api.register(r'action-points', ActionPointViewSet, base_name='action-points')
action_points_api.register(r'categories', CategoryViewSet, base_name='categories')
action_points_api.register(r'action-points', ActionPointViewSet, basename='action-points')
action_points_api.register(r'categories', CategoryViewSet, basename='categories')


urlpatterns = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,8 @@ def assign_permissions(self):
self.engagement_overview_page +
self.engagement_status_auto_date_fields +
self.engagement_status_editable_date_fields +
self.engagement_attachments_block
self.engagement_attachments_block +
self.report_editable_block
)

self.add_permissions([self.focal_point, self.auditor], 'edit', [
Expand Down
2 changes: 1 addition & 1 deletion src/etools/applications/audit/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ def submit(self, *args, **kwargs):
@transition('status', source=Engagement.STATUSES.report_submitted, target=Engagement.STATUSES.final,
permission=has_action_permission(action='finalize'))
def finalize(self, *args, **kwargs):
self.partner.spot_checks(update_one=True, event_date=self.date_of_draft_report_to_unicef)
self.partner.spot_checks(update_one=True, event_date=self.date_of_draft_report_to_ip)
return super().finalize(*args, **kwargs)

def get_object_url(self, **kwargs):
Expand Down
4 changes: 4 additions & 0 deletions src/etools/applications/audit/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,10 @@ def test_staff_spot_checks_csv_view(self):
self.assertEqual(response.status_code, status.HTTP_200_OK)
self.assertIn('text/csv', response['Content-Type'])

def test_search_by_id(self):
self._test_list(self.auditor, [self.engagement], filter_params={'search': self.engagement.pk})
self._test_list(self.auditor, filter_params={'search': -1})


class BaseTestEngagementsCreateViewSet(EngagementTransitionsTestCaseMixin):
endpoint = 'engagements'
Expand Down
16 changes: 8 additions & 8 deletions src/etools/applications/audit/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
from etools.applications.audit import views

root_api = routers.SimpleRouter()
root_api.register(r'audit-firms', views.AuditorFirmViewSet, base_name='audit-firms')
root_api.register(r'purchase-orders', views.PurchaseOrderViewSet, base_name='purchase-orders')
root_api.register(r'engagements', views.EngagementViewSet, base_name='engagements')
root_api.register(r'micro-assessments', views.MicroAssessmentViewSet, base_name='micro-assessments')
root_api.register(r'spot-checks', views.SpotCheckViewSet, base_name='spot-checks')
root_api.register(r'staff-spot-checks', views.StaffSpotCheckViewSet, base_name='staff-spot-checks')
root_api.register(r'audits', views.AuditViewSet, base_name='audits')
root_api.register(r'special-audits', views.SpecialAuditViewSet, base_name='special-audits')
root_api.register(r'audit-firms', views.AuditorFirmViewSet, basename='audit-firms')
root_api.register(r'purchase-orders', views.PurchaseOrderViewSet, basename='purchase-orders')
root_api.register(r'engagements', views.EngagementViewSet, basename='engagements')
root_api.register(r'micro-assessments', views.MicroAssessmentViewSet, basename='micro-assessments')
root_api.register(r'spot-checks', views.SpotCheckViewSet, basename='spot-checks')
root_api.register(r'staff-spot-checks', views.StaffSpotCheckViewSet, basename='staff-spot-checks')
root_api.register(r'audits', views.AuditViewSet, basename='audits')
root_api.register(r'special-audits', views.SpecialAuditViewSet, basename='special-audits')

auditor_staffmember_api = NestedComplexRouter(root_api, r'audit-firms', lookup='auditor_firm')
auditor_staffmember_api.register(r'staff-members', views.AuditorStaffMembersViewSet, base_name='auditorstaffmembers')
Expand Down
2 changes: 1 addition & 1 deletion src/etools/applications/audit/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ class EngagementViewSet(
SearchFilter, DisplayStatusFilter, DjangoFilterBackend,
UniqueIDOrderingFilter, OrderingFilter,
)
search_fields = ('partner__name', 'agreement__auditor_firm__name')
search_fields = ('partner__name', 'agreement__auditor_firm__name', '=id')
ordering_fields = ('agreement__order_number', 'agreement__auditor_firm__name',
'partner__name', 'engagement_type', 'status')
filter_class = EngagementFilter
Expand Down
32 changes: 1 addition & 31 deletions src/etools/applications/core/data/attachments_file_types.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,26 +119,6 @@
"code": "audit_report"
}
},
{
"model": "unicef_attachments.filetype",
"pk": 15,
"fields": {
"order": 0,
"label": "PCA",
"name": "pca",
"code": "audit_engagement"
}
},
{
"model": "unicef_attachments.filetype",
"pk": 16,
"fields": {
"order": 1,
"label": "PD",
"name": "pd",
"code": "audit_engagement"
}
},
{
"model": "unicef_attachments.filetype",
"pk": 17,
Expand Down Expand Up @@ -169,16 +149,6 @@
"code": "tpm_report"
}
},
{
"model": "unicef_attachments.filetype",
"pk": 21,
"fields": {
"order": 8,
"label": "PCA",
"name": "pca",
"code": "tpm"
}
},
{
"model": "unicef_attachments.filetype",
"pk": 22,
Expand Down Expand Up @@ -299,4 +269,4 @@
"code": "tpm_report_attachments"
}
}
]
]
Loading

0 comments on commit e9c64a2

Please sign in to comment.