Comments (2)
I was wrong, it doesn't look like it was about sending emails, but about setting the default value to #f
for the bot-set-id
field in the user
schema.
@Bogdanp: The same issue might exist for the api-key
field, but it is a string, and maybe deta/postgres knows to transform a default value of #f into an empty string or into null? Source (congame/components/user):
(define-schema user
([id id/f #:primary-key #:auto-increment]
[username string/f #:contract non-empty-string? #:wrapper string-downcase]
[(password-hash "") string/f]
[(api-key #f) string/f #:nullable]
[(role 'user) symbol/f #:contract (or/c 'user 'bot 'api 'admin)]
[(verified? #f) boolean/f]
[(verification-code (generate-random-string)) string/f #:contract non-empty-string?]
[bot-set-id integer/f #:nullable]
[(created-at (now/moment)) datetime-tz/f]
[(updated-at (now/moment)) datetime-tz/f])
from congame.
Yeah, I made a mistake here when I provided the default since nullables default to sql-null
already. The api-key
field doesn't have this problem because the pre-persist-hook
ensures there's always a string in that field:
#:pre-persist-hook
(lambda (u)
(define user-with-key
(cond
[(user-api-key u) u]
[else (set-user-api-key u (generate-api-key u))]))
(set-user-updated-at user-with-key (now/moment))))
from congame.
Related Issues (20)
- Why does `->jsexpr` make the load time faster when displaying files on admin? HOT 1
- koyo reloading issue HOT 3
- Long load time after lobby? DB issue? HOT 2
- Improve error message/blame when `make-step` used incorrectly
- redirect loop when enrolling from identity and first step has `skip` HOT 2
- email messages to identity need to be implemented HOT 1
- Add enrollment code to signup on congame (not identity) servers HOT 1
- `user-manager-verify` contract error HOT 1
- Study instances are launched based on name instead of id and thus have to be unique HOT 1
- get `identity-url` from DB when sending emails to identity users HOT 1
- congame-web/components/identity breaks the build
- Postgres `remaining connection slots are reserved for non-replication superuser connections` HOT 1
- Checking enrollment code: why do we need to drop the protected continuation? HOT 1
- PDF `save-file!` fails for one pdf file HOT 8
- How to get rid of the 'session expired' error at the top? HOT 1
- Impersonate does not work anymore HOT 1
- sub-study does not seem to put the `required` value HOT 5
- New package fails to compile but succeeds after changing file
- `formular` as final page of study seems not to work
- dashboard takes 50 seconds to load on login
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from congame.