aminskjen commited on
Commit
e67bfab
·
verified ·
1 Parent(s): b73b9df

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -109,6 +109,8 @@ def logout():
109
  logout_user()
110
  return redirect(url_for('index'))
111
 
 
 
112
  @app.route('/generate', methods=['POST'])
113
  def generate_content():
114
  if not cohere_client:
@@ -139,7 +141,7 @@ def generate_content():
139
  creation_id = str(uuid.uuid4())
140
  creation = Creation(
141
  id=creation_id,
142
- user_id=current_user.id,
143
  scene_idea=scene_idea,
144
  story=expanded_story,
145
  image_url=image_url
 
109
  logout_user()
110
  return redirect(url_for('index'))
111
 
112
+ # --- Modified generate route: no login required now ---
113
+
114
  @app.route('/generate', methods=['POST'])
115
  def generate_content():
116
  if not cohere_client:
 
141
  creation_id = str(uuid.uuid4())
142
  creation = Creation(
143
  id=creation_id,
144
+ user_id=current_user.id if current_user.is_authenticated else None,
145
  scene_idea=scene_idea,
146
  story=expanded_story,
147
  image_url=image_url