summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2019-01-01 09:24:42 -0500
committerDrew DeVault <sir@cmpwn.com>2019-01-01 09:24:42 -0500
commit6e962304c0d616d5b15d2dd347b0c54a24140866 (patch)
tree98af20f6b4489c9ab5e89bbb346f4b11e677c402
parentab0eff3485705ebd3122abbb82e7a2a90fdf1d3c (diff)
Fix pushing to root repo
-rwxr-xr-xmansrht-shell9
1 files changed, 5 insertions, 4 deletions
diff --git a/mansrht-shell b/mansrht-shell
index ec264cf..c356aad 100755
--- a/mansrht-shell
+++ b/mansrht-shell
@@ -11,12 +11,13 @@ except Exception as ex:
import requests
import shlex
from datetime import datetime
+from mansrht.access import has_access, UserAccess
+from mansrht.types import User, Wiki
from srht.config import cfg
-from srht.validation import Validation
from srht.database import DbSession
+from srht.oauth import UserType
+from srht.validation import Validation
db = DbSession(cfg("man.sr.ht", "connection-string"))
-from mansrht.access import has_access, UserAccess
-from mansrht.types import User, Wiki
db.init()
def log(s, *args):
@@ -57,7 +58,7 @@ if not path.startswith(repos):
cmd[-1] = path
if path == os.path.join(repos, "root"):
- if cmd[0] == "git-receive-pack" and not user.admin:
+ if cmd[0] == "git-receive-pack" and user.user_type != UserType.admin:
sys.exit(128)
else:
wiki = Wiki.query.filter(Wiki.path == path).first()