plan-your-vote / plan-your-vote-cms

1 stars 8 forks source link

Deleting current selected election will crash application #93

Closed joey-tang closed 4 years ago

joey-tang commented 4 years ago

The application heavily depends on the StateSingleton table, whatever the value of "ManagedElectionID" is will be displayed on the application.

If the user changes "Managed Election" this is reflected in this table. So when the current selected election is deleted, the State table will have its ManagedElectionID pointing to the deleted ID.

joey-tang commented 4 years ago

Deleting the current selected election now selects the next available Election after deletion. This is also now reflected in the StateSingleton table so that the application doesn't crash.

The application however, must always have at least one Election as the StateSingleton table requires an ElectionId.