By using this site, you agree to have cookies stored on your device, strictly for functional purposes, such as storing your session and preferences.

Dismiss

Remove printing

roundabout,
created on Tuesday, 28 May 2024, 08:27:26 (1716884846), received on Wednesday, 31 July 2024, 06:54:48 (1722408888)
Author identity: vlad <vlad.muntoiu@gmail.com>

e2311abb8a28f3b67303ca739d53a37201c5a601

app.py

@@ -267,7 +267,7 @@ def favourite_edit(id):

                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                if favourite.user_username != flask.session.get("username"):
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                    flask.abort(403)
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                data = flask.request.form
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            print(data)
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            # 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"))
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        

@@ -479,7 +479,7 @@ def new_repo():

                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            @app.route("/logout")
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            def logout():
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                flask.session.clear()
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            print("Logged out")
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            # print("Logged out")
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                flask.flash(Markup(
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                        "<iconify-icon icon='mdi:account'></iconify-icon>" + _("Successfully logged out")),
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                        category="info")
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        

@@ -794,7 +794,7 @@ 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)
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            # print(files)
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                return flask.render_template(
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                        "repo-commit.html",
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        

@@ -844,7 +844,7 @@ 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')}")
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            # 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 (
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        

@@ -1437,7 +1437,7 @@ 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)
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                # print(head_repo)
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                    if head not in head_repo.branches or base not in base_repo.branches:
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                        flask.flash(Markup(