volentixlabsinc / venue-server

The backend services for Venue, a community engagement platform for the Volentix community
https://venue.volentix.io
MIT License
6 stars 0 forks source link

After clearing all users, server returns only HTTP 500 #182

Closed shawnlauzon closed 6 years ago

shawnlauzon commented 6 years ago

Describe the bug With no users, getting this rollbar error

DataError: division by zero CONTEXT: SQL function "leader_board_data" statement 1

To Reproduce Steps to reproduce the behavior:

  1. Go to admin console
  2. Click on Clear campaign data
  3. Server completely broken
  4. See error on Rollbar

Expected behavior Should be 0 points awarded.

Screenshots n/a

Additional context It looks like 0 is passed as total_points to the stored function, and that is causing the error. The stored function should be updated to handle 0 points.

Blocked by Volentix/venue#138