Commit a61aad6
committed
User advertiser member check and constraint
I hit this extremely minor bug in production. If you try to add the same
user again as an authorized user on an advertiser, you hit a DB
constraint (500 error).
That's because the constraint added here exists
in production but not in the model. That is because at first the
UserAdvertiserMember model was just an automatic table and then we added
a new column to the table via migration.
This adds a secondary check to ensure we don't try to add the same user
again and adds the constraint in development. Hopefully there isn't an
issue adding that constraint again in prod or we could fake the
migration if desired since the constraint already exists.1 parent 2fabb1b commit a61aad6
File tree
4 files changed
+31
-7
lines changed- adserver
- auth
- migrations
- tests
4 files changed
+31
-7
lines changedLines changed: 18 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
255 | 255 | | |
256 | 256 | | |
257 | 257 | | |
| 258 | + | |
| 259 | + | |
258 | 260 | | |
259 | 261 | | |
260 | 262 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1252 | 1252 | | |
1253 | 1253 | | |
1254 | 1254 | | |
| 1255 | + | |
1255 | 1256 | | |
1256 | 1257 | | |
1257 | 1258 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1857 | 1857 | | |
1858 | 1858 | | |
1859 | 1859 | | |
1860 | | - | |
1861 | | - | |
1862 | | - | |
1863 | | - | |
1864 | | - | |
1865 | | - | |
1866 | | - | |
| 1860 | + | |
| 1861 | + | |
| 1862 | + | |
| 1863 | + | |
| 1864 | + | |
| 1865 | + | |
| 1866 | + | |
| 1867 | + | |
| 1868 | + | |
| 1869 | + | |
1867 | 1870 | | |
1868 | 1871 | | |
1869 | 1872 | | |
| |||
0 commit comments