Skip to content

Commit

Permalink
Merge 0e4779c into 3db2860
Browse files Browse the repository at this point in the history
  • Loading branch information
xzzy committed Aug 29, 2018
2 parents 3db2860 + 0e4779c commit b1ee761
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
8 changes: 5 additions & 3 deletions mooring/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1733,19 +1733,21 @@ def list(self, request, *args, **kwargs):
recordsTotal = cursor.fetchone()[0]
cursor.execute(sqlCount, sqlParams)
recordsFiltered = cursor.fetchone()[0]

cursor.execute(sql, sqlParams)
columns = [col[0] for col in cursor.description]
data = [
dict(zip(columns, row))
for row in cursor.fetchall()
]


bookings_qs = Booking.objects.filter(id__in=[b['id'] for b in data]).prefetch_related('mooringarea', 'campsites', 'campsites__campsite', 'customer', 'regos', 'history', 'invoices', 'canceled_by')
booking_map = {b.id: b for b in bookings_qs}
clean_data = []
for bk in data:
cg = None
booking = booking_map[bk['id']]
booking = booking_map[bk['id']]
cg = booking.mooringarea
bk['editable'] = booking.editable
bk['status'] = booking.status
Expand Down Expand Up @@ -1904,7 +1906,7 @@ def create(self, request, format=None):
print(traceback.print_exc())
raise
except ValidationError as e:
print e
print (e)
raise serializers.ValidationError(repr(e.error_dict))
except Exception as e:
utils.delete_session_booking(request.session)
Expand Down
4 changes: 2 additions & 2 deletions mooring/frontend/exploreparks/src/parkfinder.vue
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,9 @@
[v-cloak] {
display: none;
}
@font-face {
font-family: "DPaWSymbols";
src: url("assets/boating.woff") format("woff");
src: url('/static/exploreparks/fonts/boating.woff') format("woff");
}
.symb {
Expand Down Expand Up @@ -524,6 +523,7 @@ export default {
sitesInPersonIcon: require('./assets/pin_offline.svg'),
sitesAltIcon: require('./assets/pin_alt.svg'),
locationIcon: require('./assets/location.svg'),
boatingFont: require('./assets/fonts/boating.woff'),
paginate: ['filterResults'],
selectedFeature: null,
current_map_scale: 1950001,
Expand Down
2 changes: 1 addition & 1 deletion mooring/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1190,7 +1190,7 @@ def __check_refund_status(self):
invoices = Invoice.objects.filter(reference__in=references)
for i in invoices:
if i.voided:
amount += i.payment_amount
amount += i.amount
refund_amount += i.refund_amount

if amount == 0:
Expand Down
2 changes: 1 addition & 1 deletion mooring/static/exploreparks/js/map.js

Large diffs are not rendered by default.

0 comments on commit b1ee761

Please sign in to comment.