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

Block empty searches

roundabout,
created on Tuesday, 11 June 2024, 18:26:05 (1718130365), received on Wednesday, 31 July 2024, 06:54:49 (1722408889)
Author identity: vlad <vlad.muntoiu@gmail.com>

c933eab2967f5a90c61d9ac0f0dce6535f2f69d0

app.py

@@ -155,7 +155,7 @@ def about():

                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            def search():
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                query = flask.request.args.get("q")
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                if not query:
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                query = ""
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                flask.abort(400)
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                results = Repo.query.filter(Repo.name.ilike(f"%{query}%")).filter_by(visibility=2).all()
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                            
                                

config.py

@@ -25,7 +25,7 @@ MAX_PAYLOAD_SIZE: int = 4 * 1024**3

                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            AVATAR_SIZE: tuple = (192, 192)
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            HASHING_ROUNDS: int = 11
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        RESERVED_NAMES: tuple = ("git", "settings", "logout", "accounts", "info", "notifications", "about", "newrepo", "favourites",)
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        RESERVED_NAMES: tuple = ("git", "settings", "logout", "accounts", "info", "notifications", "about", "newrepo", "favourites", "data-api", "language", "help")
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            suggest_https: bool = False                      # this config is intended for a test server
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            port: int = 8080                                 # currently not shown in the UI, only used for critical communications