When a user is registrered by somebody else, they get an attendee_id of
NULL. These registrations got filtered out against the global opt-out
list, due to the NULL check.
Make it so that any registration with NULL attendee is always included.
If this user decides to opt out globally, the attendee_id field will get
populated when they do that, and the regular opt-out rules will apply.
Per-conference-series optout not affected as it was already doing the
correct thing.
q.write("\nUNION ALL\n".join(excs))
q.write("\n)\n")
q.write("SELECT DISTINCT ON (email) email, fullname, token FROM incs\n")
- q.write(" WHERE userid NOT IN (SELECT user_id FROM confreg_globaloptout)\n")
+ q.write(" WHERE (userid IS NULL OR userid NOT IN (SELECT user_id FROM confreg_globaloptout))\n")
if excs:
q.write(" and email NOT IN (SELECT email FROM excs)\n")
q.write("ORDER BY email")