fake a username
This commit is contained in:
parent
f4ad413eac
commit
ca702d6bcc
3 changed files with 5 additions and 2 deletions
4
app.py
4
app.py
|
|
@ -6,6 +6,7 @@ import traceback
|
|||
from services.sleeper_api import SleeperAPI
|
||||
from services.espn_api import ESPNAPI
|
||||
from config import Config
|
||||
from faker import Faker
|
||||
|
||||
# Force unbuffered output for Docker logs
|
||||
os.environ['PYTHONUNBUFFERED'] = '1'
|
||||
|
|
@ -87,6 +88,7 @@ def index():
|
|||
print("DEBUG: Index route accessed", flush=True)
|
||||
# Get the last used username from cookie
|
||||
last_username = request.cookies.get('last_username', '')
|
||||
mySleeperUsername = Faker().user_name()
|
||||
print(f"DEBUG: Last username from cookie: '{last_username}'", flush=True)
|
||||
|
||||
# Auto-redirect to dashboard if username cookie exists
|
||||
|
|
@ -94,7 +96,7 @@ def index():
|
|||
print(f"DEBUG: Auto-redirecting to dashboard for user: '{last_username}'", flush=True)
|
||||
return redirect(url_for('dashboard_current', username=last_username.strip()))
|
||||
|
||||
return render_template('index.html', last_username=last_username)
|
||||
return render_template('index.html', last_username=last_username, mySleeperUsername=mySleeperUsername)
|
||||
|
||||
@app.route('/dashboard')
|
||||
def dashboard_form():
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
Flask==2.3.3
|
||||
requests==2.31.0
|
||||
python-dateutil==2.8.2
|
||||
Faker==37.12.0
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
</form>
|
||||
|
||||
<div class="example">
|
||||
<p>Example: <code>mySleeperUsername</code></p>
|
||||
<p>Example: <code>{{ mySleeperUsername }}</code></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue