Skip to content

Commit

Permalink
Merge branch 'AH/develop' into AH-Permissions/UbidViewSet
Browse files Browse the repository at this point in the history
  • Loading branch information
perryr16 committed Oct 26, 2023
2 parents 0eb2ef5 + fa4c6d2 commit 7e0e99c
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 8 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- develop
- AH/develop
tags:
- "*"
workflow_dispatch:
Expand Down Expand Up @@ -43,6 +44,8 @@ jobs:
if [[ ${GITHUB_EVENT_NAME} == "push" ]]; then
if [[ "${GITHUB_REF}" == "refs/heads/develop" ]]; then
SEED_TAG=seedplatform/seed:develop
elif [[ "${GITHUB_REF}" == "refs/heads/AH/develop" ]]; then
SEED_TAG=seedplatform/seed:develop-ah
elif [[ "${GITHUB_REF}" =~ "refs/tags/v" ]]; then
# you can have multiple tags, separated by commas
SEED_TAG=seedplatform/seed:${GITHUB_REF#refs/tags/v},seedplatform/seed:latest
Expand Down
1 change: 1 addition & 0 deletions seed/tests/test_account_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ def test_dict_org(self):
'salesforce_enabled': False,
'ubid_threshold': 1.0,
'inventory_count': 0,
"access_level_names": [self.org.name]
}

org_payload = _dict_org(self.fake_request, [self.org])
Expand Down
4 changes: 2 additions & 2 deletions seed/tests/test_data_view_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -584,8 +584,8 @@ def test_evaluation_endpoint_canonical_col_permissions(self):
self.assertEqual(4, sum_count)
self.assertEqual(4, count_count)

site_eui_count = len([dataset for dataset in graph_data['datasets'] if dataset['column'] == 'site_eui'])
ghg_count = len([dataset for dataset in graph_data['datasets'] if dataset['column'] == 'total_ghg_emissions'])
site_eui_count = len([dataset for dataset in graph_data['datasets'] if dataset['column'] == 'Site EUI'])
ghg_count = len([dataset for dataset in graph_data['datasets'] if dataset['column'] == 'Total GHG Emissions'])
self.assertEqual(10, site_eui_count)
self.assertEqual(10, ghg_count)

Expand Down
2 changes: 2 additions & 0 deletions seed/tests/test_meter_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,7 @@ def test_create_two_meters_readings(self):
"""Test edge case to make sure that data for two different meters don't overwrite each other"""
property_view = self.property_view_factory.get_property_view()
url_meters = reverse('api:v3:property-meters-list', kwargs={'property_pk': property_view.id})
url_meters += "?organization_id=" + str(self.org.id)

payload = {
'type': 'Electric',
Expand Down Expand Up @@ -398,6 +399,7 @@ def test_create_two_meters_bulk_readings(self):
"""Test edge case to make sure that data for two different meters don't overwrite each other"""
property_view = self.property_view_factory.get_property_view()
url_meters = reverse('api:v3:property-meters-list', kwargs={'property_pk': property_view.id})
url_meters += "?organization_id=" + str(self.org.id)

payload = {
'type': 'Electric',
Expand Down
2 changes: 1 addition & 1 deletion seed/tests/test_property_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1100,7 +1100,7 @@ def test_property_upload_inventory_document(self):
assert resp.status_code == 404

def test_property_analyses(self):
url = reverse('api:v3:properties-analyses', args=[self.view.id]) + f'?organization_id={self.org.pk}'
url = reverse('api:v3:properties-analyses', args=[self.property.id]) + f'?organization_id={self.org.pk}'

# root member can
self.login_as_root_member()
Expand Down
4 changes: 0 additions & 4 deletions seed/views/v3/analyses.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,6 @@ def list(self, request):
access_level_instance__rgt__lte=access_level_instance.rgt,
).order_by('-id')

analyses_queryset = (
Analysis.objects.filter(organization=organization_id)
.order_by('-id')
)
for analysis in analyses_queryset:
serialized_analysis = AnalysisSerializer(analysis).data
serialized_analysis.update(analysis.get_property_view_info())
Expand Down
2 changes: 1 addition & 1 deletion seed/views/v3/properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ def meter_usage(self, request, pk):
@ajax_request_class
@has_perm_class('requires_viewer')
@action(detail=True, methods=['GET'])
@has_hierarchy_access(property_view_id_kwarg="pk")
@has_hierarchy_access(property_id_kwarg="pk")
def analyses(self, request, pk):
organization_id = self.get_organization(request)

Expand Down

0 comments on commit 7e0e99c

Please sign in to comment.