Spaces:
				
			
			
	
			
			
		Sleeping
		
	
	
	
			
			
	
	
	
	
		
		
		Sleeping
		
	Update app.py
Browse files
    	
        app.py
    CHANGED
    
    | @@ -29,6 +29,14 @@ print("Session interface configured.") | |
| 29 | 
             
            # Ensure secure session handling for environments like Hugging Face
         | 
| 30 | 
             
            app.session_interface = SecureCookieSessionInterface()
         | 
| 31 | 
             
            print("Session interface configured.")
         | 
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
| 32 |  | 
| 33 | 
             
            @app.route("/")
         | 
| 34 | 
             
            def home():
         | 
| @@ -46,7 +54,8 @@ def signup(): | |
| 46 | 
             
                            "Name": name,
         | 
| 47 | 
             
                            "Phone_Number__c": phone,
         | 
| 48 | 
             
                            "Email__c": email,
         | 
| 49 | 
            -
                            "Password__c": password
         | 
|  | |
| 50 | 
             
                        })
         | 
| 51 | 
             
                        return redirect(url_for("login"))
         | 
| 52 | 
             
                    except Exception as e:
         | 
|  | |
| 29 | 
             
            # Ensure secure session handling for environments like Hugging Face
         | 
| 30 | 
             
            app.session_interface = SecureCookieSessionInterface()
         | 
| 31 | 
             
            print("Session interface configured.")
         | 
| 32 | 
            +
            import random
         | 
| 33 | 
            +
            import string
         | 
| 34 | 
            +
             | 
| 35 | 
            +
            def generate_referral_code(length=8):
         | 
| 36 | 
            +
                # Generates a random referral code with uppercase, lowercase letters, and digits
         | 
| 37 | 
            +
                characters = string.ascii_letters + string.digits  # A-Z, a-z, 0-9
         | 
| 38 | 
            +
                referral_code = ''.join(random.choice(characters) for _ in range(length))
         | 
| 39 | 
            +
                return referral_code
         | 
| 40 |  | 
| 41 | 
             
            @app.route("/")
         | 
| 42 | 
             
            def home():
         | 
|  | |
| 54 | 
             
                            "Name": name,
         | 
| 55 | 
             
                            "Phone_Number__c": phone,
         | 
| 56 | 
             
                            "Email__c": email,
         | 
| 57 | 
            +
                            "Password__c": password,
         | 
| 58 | 
            +
                            "Referral__c": referral_code
         | 
| 59 | 
             
                        })
         | 
| 60 | 
             
                        return redirect(url_for("login"))
         | 
| 61 | 
             
                    except Exception as e:
         | 
