roundabout,
created on Tuesday, 25 June 2024, 08:13:30 (1719303210),
received on Wednesday, 31 July 2024, 06:54:50 (1722408890)
Author identity: vlad <vlad.muntoiu@gmail.com>
70d2b3f2d62de1e0aa786f67981965cb5e48c1d9
app.py
@@ -293,13 +293,10 @@ def favourite_edit(id):
if favourite.user_username != flask.session.get("username"): flask.abort(403) data = flask.request.form # print(data)favourite.notify_commit = js_to_bool(data.get("commit")) favourite.notify_forum = js_to_bool(data.get("forum")) favourite.notify_pr = js_to_bool(data.get("pull_request")) favourite.notify_admin = js_to_bool(data.get("administrative")) print(favourite.notify_commit, favourite.notify_forum, favourite.notify_pr,favourite.notify_admin)db.session.commit() return flask.render_template_string( """
@@ -505,7 +502,6 @@ def new_repo():
@app.route("/logout") def logout(): flask.session.clear() # print("Logged out")flask.flash(Markup( "<iconify-icon icon='mdi:account'></iconify-icon>" + _("Successfully logged out")), category="info")
@@ -599,17 +595,13 @@ def user_avatar_upload(username):
def repository_raw(username, repository, branch, subpath): server_repo_location = os.path.join(config.REPOS_PATH, username, repository) if not os.path.exists(server_repo_location): app.logger.error(f"Cannot load {server_repo_location}")flask.abort(404) if not (get_visibility(username, repository) or get_permission_level( flask.session.get("username"), username, repository) is not None): flask.abort(403) app.logger.info(f"Loading {server_repo_location}")if not os.path.exists(server_repo_location): app.logger.error(f"Cannot load {server_repo_location}")return flask.render_template("errors/not-found.html"), 404 repo = git.Repo(server_repo_location)
@@ -648,15 +640,12 @@ def repository_raw(username, repository, branch, subpath):
def repository_tree(username, repository, branch, subpath): server_repo_location = os.path.join(config.REPOS_PATH, username, repository) if not os.path.exists(server_repo_location): app.logger.error(f"Cannot load {server_repo_location}")flask.abort(404) if not (get_visibility(username, repository) or get_permission_level( flask.session.get("username"), username, repository) is not None): flask.abort(403) app.logger.info(f"Loading {server_repo_location}")repo = git.Repo(server_repo_location) repo_data = Repo.query.filter_by(route=f"/{username}/{repository}").first() if not repo_data.default_branch:
@@ -801,17 +790,13 @@ def repository_tree(username, repository, branch, subpath):
def repository_commit(username, repository, sha): server_repo_location = os.path.join(config.REPOS_PATH, username, repository) if not os.path.exists(server_repo_location): app.logger.error(f"Cannot load {server_repo_location}")flask.abort(404) if not (get_visibility(username, repository) or get_permission_level( flask.session.get("username"), username, repository) is not None): flask.abort(403) app.logger.info(f"Loading {server_repo_location}")if not os.path.exists(server_repo_location): app.logger.error(f"Cannot load {server_repo_location}")return flask.render_template("errors/not-found.html"), 404 repo = git.Repo(server_repo_location)
@@ -820,8 +805,6 @@ def repository_commit(username, repository, sha):
files = git_command(os.path.join(server_repo_location, ".git"), None, "diff-tree", "-r", "--name-only", "--no-commit-id", sha).decode().split("\n")[:-1] # print(files)return flask.render_template( "repo-commit.html", username=username,
@@ -842,7 +825,6 @@ def repository_commit(username, repository, sha):
def repository_commit_add_comment(username, repository, sha): server_repo_location = os.path.join(config.REPOS_PATH, username, repository) if not os.path.exists(server_repo_location): app.logger.error(f"Cannot load {server_repo_location}")flask.abort(404) if not (get_visibility(username, repository) or get_permission_level( flask.session.get("username"), username,
@@ -870,7 +852,6 @@ def repository_commit_add_comment(username, repository, sha):
@repositories.route("/<username>/<repository>/commit/<sha>/delete_comment/<int:id>", methods=["POST"]) def repository_commit_delete_comment(username, repository, sha, id): repo_data = Repo.query.filter_by(route=f"/{username}/{repository}").first() # print(f"/{username}/{repository}/{flask.request.form.get('id')}")comment = Comment.query.filter_by(identifier=f"/{username}/{repository}/{id}").first() commit = Commit.query.filter_by(identifier=f"/{username}/{repository}/{sha}").first() if (
@@ -908,17 +889,13 @@ def repository_commit_resolve_comment(username, repository, sha, id):
def repository_forum(username, repository): server_repo_location = os.path.join(config.REPOS_PATH, username, repository) if not os.path.exists(server_repo_location): app.logger.error(f"Cannot load {server_repo_location}")flask.abort(404) if not (get_visibility(username, repository) or get_permission_level( flask.session.get("username"), username, repository) is not None): flask.abort(403) app.logger.info(f"Loading {server_repo_location}")if not os.path.exists(server_repo_location): app.logger.error(f"Cannot load {server_repo_location}")return flask.render_template("errors/not-found.html"), 404 repo = git.Repo(server_repo_location)
@@ -946,17 +923,13 @@ def repository_forum(username, repository):
def repository_forum_topic(username, repository, id): server_repo_location = os.path.join(config.REPOS_PATH, username, repository) if not os.path.exists(server_repo_location): app.logger.error(f"Cannot load {server_repo_location}")flask.abort(404) if not (get_visibility(username, repository) or get_permission_level( flask.session.get("username"), username, repository) is not None): flask.abort(403) app.logger.info(f"Loading {server_repo_location}")if not os.path.exists(server_repo_location): app.logger.error(f"Cannot load {server_repo_location}")return flask.render_template("errors/not-found.html"), 404 repo_data = Repo.query.filter_by(route=f"/{username}/{repository}").first()
@@ -984,17 +957,13 @@ def repository_forum_topic(username, repository, id):
def repository_forum_new(username, repository): server_repo_location = os.path.join(config.REPOS_PATH, username, repository) if not os.path.exists(server_repo_location): app.logger.error(f"Cannot load {server_repo_location}")flask.abort(404) if not (get_visibility(username, repository) or get_permission_level( flask.session.get("username"), username, repository) is not None): flask.abort(403) app.logger.info(f"Loading {server_repo_location}")if not os.path.exists(server_repo_location): app.logger.error(f"Cannot load {server_repo_location}")return flask.render_template("errors/not-found.html"), 404 repo = git.Repo(server_repo_location)
@@ -1019,17 +988,13 @@ def repository_forum_new(username, repository):
def repository_forum_thread(username, repository, post_id): server_repo_location = os.path.join(config.REPOS_PATH, username, repository) if not os.path.exists(server_repo_location): app.logger.error(f"Cannot load {server_repo_location}")flask.abort(404) if not (get_visibility(username, repository) or get_permission_level( flask.session.get("username"), username, repository) is not None): flask.abort(403) app.logger.info(f"Loading {server_repo_location}")if not os.path.exists(server_repo_location): app.logger.error(f"Cannot load {server_repo_location}")return flask.render_template("errors/not-found.html"), 404 repo = git.Repo(server_repo_location)
@@ -1068,13 +1033,10 @@ def repository_forum_thread(username, repository, post_id):
def repository_forum_change_state(username, repository, post_id): server_repo_location = os.path.join(config.REPOS_PATH, username, repository) if not os.path.exists(server_repo_location): app.logger.error(f"Cannot load {server_repo_location}")flask.abort(404) if (not get_permission_level(flask.session.get("username"), username, repository)) and db.session.get(Post, f"/{username}/{repository}/{post_id}").owner.username != flask.session.get("username"): flask.abort(403) app.logger.info(f"Loading {server_repo_location}")repo = git.Repo(server_repo_location) repo_data = Repo.query.filter_by(route=f"/{username}/{repository}").first() user = User.query.filter_by(username=flask.session.get("username")).first()
@@ -1100,17 +1062,13 @@ def repository_forum_change_state(username, repository, post_id):
def repository_forum_reply(username, repository, post_id): server_repo_location = os.path.join(config.REPOS_PATH, username, repository) if not os.path.exists(server_repo_location): app.logger.error(f"Cannot load {server_repo_location}")flask.abort(404) if not (get_visibility(username, repository) or get_permission_level( flask.session.get("username"), username, repository) is not None): flask.abort(403) app.logger.info(f"Loading {server_repo_location}")if not os.path.exists(server_repo_location): app.logger.error(f"Cannot load {server_repo_location}")return flask.render_template("errors/not-found.html"), 404 repo = git.Repo(server_repo_location)
@@ -1143,17 +1101,13 @@ def repository_forum_reply(username, repository, post_id):
def repository_forum_vote(username, repository, post_id, score): server_repo_location = os.path.join(config.REPOS_PATH, username, repository) if not os.path.exists(server_repo_location): app.logger.error(f"Cannot load {server_repo_location}")flask.abort(404) if not (get_visibility(username, repository) or get_permission_level( flask.session.get("username"), username, repository) is not None): flask.abort(403) app.logger.info(f"Loading {server_repo_location}")if not os.path.exists(server_repo_location): app.logger.error(f"Cannot load {server_repo_location}")return flask.render_template("errors/not-found.html"), 404 repo = git.Repo(server_repo_location)
@@ -1197,17 +1151,13 @@ def repository_forum_vote(username, repository, post_id, score):
def repository_favourite(username, repository): server_repo_location = os.path.join(config.REPOS_PATH, username, repository) if not os.path.exists(server_repo_location): app.logger.error(f"Cannot load {server_repo_location}")flask.abort(404) if not (get_visibility(username, repository) or get_permission_level( flask.session.get("username"), username, repository) is not None): flask.abort(403) app.logger.info(f"Loading {server_repo_location}")if not os.path.exists(server_repo_location): app.logger.error(f"Cannot load {server_repo_location}")return flask.render_template("errors/not-found.html"), 404 repo = git.Repo(server_repo_location)
@@ -1235,17 +1185,13 @@ def repository_favourite(username, repository):
def repository_users(username, repository): server_repo_location = os.path.join(config.REPOS_PATH, username, repository) if not os.path.exists(server_repo_location): app.logger.error(f"Cannot load {server_repo_location}")flask.abort(404) if not (get_visibility(username, repository) or get_permission_level( flask.session.get("username"), username, repository) is not None): flask.abort(403) app.logger.info(f"Loading {server_repo_location}")if not os.path.exists(server_repo_location): app.logger.error(f"Cannot load {server_repo_location}")return flask.render_template("errors/not-found.html"), 404 repo = git.Repo(server_repo_location)
@@ -1296,17 +1242,13 @@ def repository_users(username, repository):
def repository_branches(username, repository): server_repo_location = os.path.join(config.REPOS_PATH, username, repository) if not os.path.exists(server_repo_location): app.logger.error(f"Cannot load {server_repo_location}")flask.abort(404) if not (get_visibility(username, repository) or get_permission_level( flask.session.get("username"), username, repository) is not None): flask.abort(403) app.logger.info(f"Loading {server_repo_location}")if not os.path.exists(server_repo_location): app.logger.error(f"Cannot load {server_repo_location}")return flask.render_template("errors/not-found.html"), 404 repo = git.Repo(server_repo_location)
@@ -1328,17 +1270,13 @@ def repository_branches(username, repository):
def repository_log(username, repository, branch): server_repo_location = os.path.join(config.REPOS_PATH, username, repository) if not os.path.exists(server_repo_location): app.logger.error(f"Cannot load {server_repo_location}")flask.abort(404) if not (get_visibility(username, repository) or get_permission_level( flask.session.get("username"), username, repository) is not None): flask.abort(403) app.logger.info(f"Loading {server_repo_location}")if not os.path.exists(server_repo_location): app.logger.error(f"Cannot load {server_repo_location}")return flask.render_template("errors/not-found.html"), 404 repo = git.Repo(server_repo_location)
@@ -1421,17 +1359,13 @@ def repository_log(username, repository, branch):
def repository_prs(username, repository): server_repo_location = os.path.join(config.REPOS_PATH, username, repository) if not os.path.exists(server_repo_location): app.logger.error(f"Cannot load {server_repo_location}")flask.abort(404) if not (get_visibility(username, repository) or get_permission_level( flask.session.get("username"), username, repository) is not None): flask.abort(403) app.logger.info(f"Loading {server_repo_location}")if not os.path.exists(server_repo_location): app.logger.error(f"Cannot load {server_repo_location}")return flask.render_template("errors/not-found.html"), 404 if flask.request.method == "GET":
@@ -1463,7 +1397,6 @@ def repository_prs(username, repository):
head_repo = git.Repo(os.path.join(config.REPOS_PATH, head_route.lstrip("/"))) base_repo = git.Repo(server_repo_location) # print(head_repo)if head not in head_repo.branches or base not in base_repo.branches: flask.flash(Markup(
@@ -1505,7 +1438,6 @@ def repository_prs(username, repository):
def repository_prs_merge(username, repository): server_repo_location = os.path.join(config.REPOS_PATH, username, repository) if not os.path.exists(server_repo_location): app.logger.error(f"Cannot load {server_repo_location}")flask.abort(404) if not (get_visibility(username, repository) or get_permission_level( flask.session.get("username"), username,
@@ -1542,7 +1474,6 @@ def repository_prs_merge(username, repository):
def repository_prs_merge_stage_two(username, repository, id): server_repo_location = os.path.join(config.REPOS_PATH, username, repository) if not os.path.exists(server_repo_location): app.logger.error(f"Cannot load {server_repo_location}")flask.abort(404) if not (get_visibility(username, repository) or get_permission_level( flask.session.get("username"), username,
@@ -1592,7 +1523,6 @@ def task_monitor(task_id):
def repository_prs_delete(username, repository): server_repo_location = os.path.join(config.REPOS_PATH, username, repository) if not os.path.exists(server_repo_location): app.logger.error(f"Cannot load {server_repo_location}")flask.abort(404) if not (get_visibility(username, repository) or get_permission_level( flask.session.get("username"), username,
email_send.py
@@ -21,8 +21,6 @@ def make_multipart_message(subject, sender, receiver, template, **kwargs):
html = MIMEText(env_html.get_template(template+".html").render(**kwargs, config=config), "html") message.attach(text) message.attach(text)print(text)message.attach(html)return message.as_string()