diff --git a/models/user.ts b/models/user.ts index b320c10..48a4c58 100644 --- a/models/user.ts +++ b/models/user.ts @@ -46,10 +46,10 @@ export default class User extends Model { @TypeORM.Column({ nullable: true, type: "boolean" }) is_show: boolean; - @TypeORM.Column({ nullable: true, type: "boolean" }) + @TypeORM.Column({ nullable: true, type: "boolean", default: true }) public_email: boolean; - @TypeORM.Column({ nullable: true, type: "boolean" }) + @TypeORM.Column({ nullable: true, type: "boolean", default: true }) prefer_formatted_code: boolean; @TypeORM.Column({ nullable: true, type: "integer" }) diff --git a/modules/api.js b/modules/api.js index 2d3c5df..13ebee6 100644 --- a/modules/api.js +++ b/modules/api.js @@ -111,11 +111,9 @@ app.post('/api/sign_up', async (req, res) => { username: req.body.username, password: req.body.password, email: req.body.email, - public_email: true, is_show: syzoj.config.default.user.show, rating: syzoj.config.default.user.rating, - register_time: parseInt((new Date()).getTime() / 1000), - prefer_formatted_code: true + register_time: parseInt((new Date()).getTime() / 1000) }); await user.save(); @@ -200,11 +198,9 @@ app.get('/api/sign_up_confirm', async (req, res) => { username: obj.username, password: obj.password, email: obj.email, - public_email: true, is_show: syzoj.config.default.user.show, rating: syzoj.config.default.user.rating, - register_time: parseInt((new Date()).getTime() / 1000), - prefer_formatted_code: true + register_time: parseInt((new Date()).getTime() / 1000) }); await user.save();