From 727ae8899d2c8fc2de7be7c2744d039f0b4157f0 Mon Sep 17 00:00:00 2001
From: Martin Mares <mj@ucw.cz>
Date: Sat, 16 Jan 2021 15:55:57 +0100
Subject: [PATCH] =?UTF-8?q?Pr=C3=A1va:=20Ka=C5=BEd=C3=BD=20job=20m=C3=A1?=
 =?UTF-8?q?=20dve=C5=99n=C3=ADka?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 mo/jobs/__init__.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/mo/jobs/__init__.py b/mo/jobs/__init__.py
index 12f40be8..31c9d467 100644
--- a/mo/jobs/__init__.py
+++ b/mo/jobs/__init__.py
@@ -4,12 +4,12 @@ from datetime import timedelta
 import os
 import secrets
 from sqlalchemy import or_
-from sqlalchemy.orm import joinedload
 from typing import Optional, Dict, Callable, List
 
 import mo
 import mo.config as config
 import mo.db as db
+import mo.rights
 import mo.util
 from mo.util import logger
 
@@ -29,6 +29,7 @@ class TheJob:
 
     job: db.Job
     job_id: Optional[int]
+    gatekeeper: Optional[mo.rights.Gatekeeper]
     errors: List[str]
 
     def __init__(self, job_id: Optional[int] = None):
@@ -115,6 +116,7 @@ class TheJob:
         sess.commit()
 
         try:
+            self.gatekeeper = mo.rights.Gatekeeper(job.user)
             _handler_table[job.type](self)
             if self.errors:
                 logger.info(f'Job: Neúspěšně dokončen job #{job.job_id} ({job.result})')
-- 
GitLab