Browse Source

Oh I may have broken sqlite...

master
hewenyang 7 years ago
parent
commit
97beb526e1
  1. 5
      modules/problem.js

5
modules/problem.js

@ -583,7 +583,10 @@ async function setPublic(req, res, is_public) {
problem.publicizer_id = res.locals.user.id;
await problem.save();
await syzoj.db.query("UPDATE `judge_state` JOIN `problem` ON `problem`.`id` = `judge_state`.`problem_id` SET `judge_state`.`is_public` = `problem`.`is_public` WHERE `problem`.`id` = " + id);
JudgeState.model.update(
{ is_public: is_public },
{ where: { problem_id: id } }
);
res.redirect(syzoj.utils.makeUrl(['problem', id]));
} catch (e) {

Loading…
Cancel
Save