File tree Expand file tree Collapse file tree 3 files changed +12
-3
lines changed
client/src/pages/DataView360 Expand file tree Collapse file tree 3 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -197,7 +197,7 @@ class DataView360 extends Component {
197
197
< Donations donations = { _ . get ( this . state , 'participantData.donations' ) } />
198
198
< Adoptions adoptions = { _ . get ( this . state , 'participantData.adoptions' ) } />
199
199
< Volunteer volunteer = { _ . get ( this . state , 'participantData.shifts' ) }
200
- volunteerShifts = { _ . get ( this . state , 'participantData.volgistics_shifts_results ' ) } />
200
+ volunteerShifts = { _ . get ( this . state , 'participantData.shifts ' ) } />
201
201
202
202
</ Paper > ) }
203
203
{ this . state . isDataBusy === true && (
Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ class Adoptions extends Component {
52
52
</ TableHead >
53
53
< TableBody >
54
54
< StyledTableRow >
55
- < TableCell align = "center" > { _ . size ( this . getAnimalIds ( ) ) } </ TableCell >
55
+ < TableCell align = "center" > { _ . size ( this . props . adoptions ) } </ TableCell >
56
56
</ StyledTableRow >
57
57
</ TableBody >
58
58
</ Table >
Original file line number Diff line number Diff line change 4
4
from sqlalchemy .sql import text
5
5
import requests
6
6
import json
7
+ import dateutil .parser
7
8
from secrets import SHELTERLUV_SECRET_TOKEN
8
9
9
10
@@ -52,7 +53,15 @@ def get_360(matching_id):
52
53
if row ["source_type" ] == "volgistics" :
53
54
shifts_query = text ("select * from volgisticsshifts where number = :volgistics_id" )
54
55
volgistics_shifts_query_result = connection .execute (shifts_query , volgistics_id = row ["source_id" ])
55
- volgisticsshifts_results = [dict (row ) for row in volgistics_shifts_query_result ]
56
+ volgisticsshifts_results = []
57
+ for r in volgistics_shifts_query_result :
58
+ shifts = dict (r )
59
+ # normalize date string
60
+ parsed_date_from = dateutil .parser .parse (shifts ["from" ], ignoretz = True )
61
+ normalized_date_from = parsed_date_from .strftime ("%Y-%m-%d" )
62
+ shifts ["from" ] = normalized_date_from
63
+ volgisticsshifts_results .append (shifts )
64
+
56
65
result ['shifts' ] = volgisticsshifts_results
57
66
58
67
if row ["source_type" ] == "shelterluvpeople" :
You can’t perform that action at this time.
0 commit comments