Deux's users were originally seeded from a clone of the rDrama DB.
Thereby, user IDs are paired between the sites, and this is further
the only clear means by which we can link accounts between the sites.
However, signups on either site after the seeding will not have
synchronized IDs. Newer accounts on Drama could thereby be used to
sign into the Deux account with the same user_id.
There's no clear way to solve this without going to a shared identity
provider for both. In the interim, we restrict shared login to users
from before divergence began. This is a kludge, but it works.
* poll rework
* forgot to do joinedload on comments
* Fix logic errors with voting, SQL syntax.
Kitchen sink commit from review of poll-rework changes:
1. Fix seed-db.sql syntax error.
2. Fix SQL patch file duplication of *submissions* tables rather
than one set of submissions and one for comments.
3. Start makeshift SQL patch folder, since this is a large change
that contributors may wish to apply to their local instances.
4. Fix checkbox (non-`exclusive`) polls being unable to be
unchecked. For consistency with `exclusive` polls, they should.
5. Fix changing the option of an `exclusive` poll when both
exclusive and non-exclusive options are present in one comment/
post causing the non-exclusive options to become unchecked.
(which, by my reading of SQLAlchemy `Query.one_or_none()`
really could break quite badly in some cases).
* link relationships with their counterparts
* small modification to poll unchecking
Co-authored-by: TLSM <duolsm@outlook.com>
First, the apparent errors with >= 9 and 99 in the Marseys and
referrals code after the refactor are not actually bugs: they were
bug fixes mixed in with the refactor to fix an off-by-one.
Next, instead of failing silently on the `not user` branch in
badge_grant, we throw a ValueError. This retains the current
behavior where users get 500s to report while also enforcing the
assertion near the edge of the function.