Browse Source

Fix CE submissions' score is NULL

pull/6/head
Menci 5 years ago
parent
commit
081d74f1c3
  1. 3
      models/common.ts
  2. 4
      models/judge_state.ts

3
models/common.ts

@ -86,7 +86,10 @@ export default class Model extends TypeORM.BaseEntity {
}
}
async saveHook(): Promise<void> {}
async save(): Promise<this> {
await this.saveHook();
await super.save();
if ((this.constructor as typeof Model).cache) {
cacheSet(this.constructor.name, (this as any).id, this);

4
models/judge_state.ts

@ -114,6 +114,10 @@ export default class JudgeState extends Model {
}
}
async saveHook() {
if (this.score === null) this.score = 0;
}
async isAllowedVisitBy(user) {
await this.loadRelationships();

Loading…
Cancel
Save