Skip to content

Commit

Permalink
Merge pull request #741 from MarkLark86/1.29
Browse files Browse the repository at this point in the history
1.29
  • Loading branch information
MarkLark86 authored Jul 9, 2019
2 parents 15a64ff + cbdb3e1 commit 1b175fc
Show file tree
Hide file tree
Showing 8 changed files with 87 additions and 16 deletions.
30 changes: 29 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,34 @@

## [unreleased]
## [1.29.3] NOT RELEASE YET
### Superdesk Change Log
#### Added
- [SDESK-4436] Template for downloading events for courts listing

#### Fixed
- fix(pollution macro) retry requests
- fix(abs macro) upate item when exected on stage macro

### Superdesk Planning Change Log
#### Added
- [SDESK-4063] Add loader animation on file upload
- [SDESK-4400] Time in Event exports are in UTC instead of server timezone
- [SDESK-4329] Show coverage type in palnning widget coverage details
- [SDESK-4307] Locations Management enhancements
- [SDESK-4375] Show 'genre' in assignments list view
- [SDESK-4377] Make ed-note editable in add-to-planning modal
- [SDBELGA-108] Add unused templates at the end of recent event templates list.
- [SDBELGA-108] List all recent event templates is 'limit' query param was not provided.
- [SDBELGA-108] Store event related data as subdict in event templates schema.
- [SDBELGA-108] Event temlates API.
- [SDESK-4368] Publish time in delivery record is not taking content item's publish schedule into account

#### Fixed
- (fix) Limit pydocstyle < 4.0
- [SDESK-4453] Coverage schedule time for published or scheduled news item should be derived from the news item
- [SDESK-4451] sequence_no in delivery record was null instead of 0 by default
- [SDESK-4410] Location from an event was not getting deleted
- [SDESK-4410] Bug when setting time for Coverage Schedule Date
- [SDESK-4414] Locking linked updated news story was locking the assignment

## [0.1] - 2015-09-04

Expand Down
2 changes: 1 addition & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"license": "GPL-3.0",
"dependencies": {
"superdesk-core": "superdesk/superdesk-client-core#7b86cf5",
"superdesk-planning": "superdesk/superdesk-planning#a82b642",
"superdesk-planning": "superdesk/superdesk-planning#687122f",
"superdesk-analytics": "superdesk/superdesk-analytics#e4188fd"
}
}
11 changes: 11 additions & 0 deletions server/aap/macros/abs_indicators.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
import time
import logging
from flask import render_template_string
from superdesk import get_resource_service
from superdesk.utils import config

cpi_url = 'CPI/2.50.999901.20.Q'
cpi_token = '__CPI__'
Expand Down Expand Up @@ -136,6 +138,15 @@ def abs_expand(item, **kwargs):
except Exception as ex:
logger.warning(ex)

# If the macro is being executed by a stage macro then update the item directly
if 'desk' in kwargs and 'stage' in kwargs:
update = {'body_html': item.get('body_html', ''),
'abstract': item.get('abstract', ''),
'headline': item.get('headline', '')}
get_resource_service('archive').system_update(item[config.ID_FIELD], update, item)

return get_resource_service('archive').find_one(req=None, _id=item[config.ID_FIELD])

return item


Expand Down
24 changes: 21 additions & 3 deletions server/aap/macros/pollution_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,16 @@ def generate_pollution_story(item, **kwargs):
# the regional value or just the site value, regional value rows seem to also contain a site value AQI
# The results are stored into the values map
url = 'https://airquality.environment.nsw.gov.au/aquisnetnswphp/getPage.php?reportid=1'
page = requests.get(url)
tries = 0
while tries < 5:
try:
page = requests.get(url, timeout=5, verify=False, allow_redirects=True)
break
except Exception as ex:
logger.exception(ex)
tries += 1
if tries == 5:
raise ex
tree = html.fromstring(page.content)
rows = tree.xpath('/html/body/table[2]/tbody/tr')
for row in rows:
Expand Down Expand Up @@ -82,8 +91,17 @@ def generate_pollution_story(item, **kwargs):

# Attempt to extract the forecast from the page below
url = 'https://airquality.environment.nsw.gov.au/aquisnetnswphp/getPage.php?reportid=9'
page = requests.get(url)
tree = html.fromstring(page.content)
tries = 0
while tries < 5:
try:
forecast_page = requests.get(url, timeout=5, verify=False, allow_redirects=True)
break
except Exception as ex:
logger.exception(ex)
tries += 1
if tries == 5:
raise ex
tree = html.fromstring(forecast_page.content)
# Extract the value
values_map['sydney_forecast'] = str(tree.xpath('/html/body/center/table/tbody/tr[1]/td/p/b/text()')[0])
# Get the day that the forecast is for
Expand Down
30 changes: 21 additions & 9 deletions server/data/planning_export_templates.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
[{
"_id" : "planning_outlook",
"name" : "outlook",
"type" : "planning",
"data" : {
"slugline" : "Outlook",
"body_html_template" : "outlook_planning_template.html"
[
{
"_id" : "planning_outlook",
"name" : "outlook",
"type" : "planning",
"data" : {
"slugline" : "Outlook",
"body_html_template" : "outlook_planning_template.html"
},
"label" : "Outlook"
},
"label" : "Outlook"
}]
{
"_id" : "event_courts_download",
"name" : "event_courts_download",
"type" : "event",
"data" : {
"template_file" : "event_courts_download.html"
},
"label" : "Courts",
"download" : true
}
]
2 changes: 1 addition & 1 deletion server/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ oauth2client==4.1.3
requests<2.22

git+git://github.com/superdesk/superdesk-core.git@93ac7cb#egg=Superdesk-Core
git+git://github.com/superdesk/superdesk-planning.git@a82b642#egg=superdesk-planning
git+git://github.com/superdesk/superdesk-planning.git@687122f#egg=superdesk-planning
git+git://github.com/superdesk/superdesk-analytics.git@e4188fd#egg=superdesk-analytics
2 changes: 2 additions & 0 deletions server/templates/event_courts_download.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{% for item in items %}{{ item['dates']['start'].strftime('%H%M') }} - {{ item['name'] }}.{% if (item.get('location') or [])|length > 0 %}{% for l in item.location %} {{ l.name }}{% endfor %}{% endif %}
{% endfor %}
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

setup(
name='Superdesk-Server',
version='0.1.3-dev',
version='1.29.3-rc2',
description='Superdesk REST API server',
long_description=LONG_DESCRIPTION,
author='petr jasek',
Expand Down

0 comments on commit 1b175fc

Please sign in to comment.