|
|
@ -101,9 +101,13 @@ class JudgeState extends Model { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
async loadRelationships() { |
|
|
|
async loadRelationships() { |
|
|
|
|
|
|
|
if (!this.user) { |
|
|
|
this.user = await User.fromID(this.user_id); |
|
|
|
this.user = await User.fromID(this.user_id); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (!this.problem) { |
|
|
|
if (this.problem_id) this.problem = await Problem.fromID(this.problem_id); |
|
|
|
if (this.problem_id) this.problem = await Problem.fromID(this.problem_id); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
async isAllowedVisitBy(user) { |
|
|
|
async isAllowedVisitBy(user) { |
|
|
|
await this.loadRelationships(); |
|
|
|
await this.loadRelationships(); |
|
|
|