@@ -133,7 +133,7 @@ def new():
133133 "templateItems" : finalData ,
134134 "lastUpdated" : str (datetime .datetime .now (utc ))
135135 })
136- return redirect (f"{ path } { host } /" )
136+ return redirect (f"/" )
137137 else :
138138 return render_template ('new.html' )
139139
@@ -166,7 +166,7 @@ def collectionAddField(id):
166166 "type" : request .form ['fieldType' ]
167167 })
168168 collectionsDB .put (data )
169- return redirect (f"{ path } { host } /collection/" + id + "/edit" )
169+ return redirect (f"/collection/" + id + "/edit" )
170170
171171@app .route ('/collection/<id>/edit/edit-field/<field>' , methods = ['POST' ])
172172def collectionEditField (id , field ):
@@ -179,7 +179,7 @@ def collectionEditField(id, field):
179179 "type" : request .form ['fieldType' ]
180180 }
181181 collectionsDB .put (data )
182- return redirect (f"{ path } { host } /collection/" + id + "/edit" )
182+ return redirect (f"/collection/" + id + "/edit" )
183183
184184@app .route ('/collection/<id>/edit/delete-field/<field>' , methods = ['GET' ])
185185def collectionDeleteField (id , field ):
@@ -188,19 +188,19 @@ def collectionDeleteField(id, field):
188188 if int (templateItem ['id' ]) == int (field ):
189189 del data ['templateItems' ][templateItemIndex ]
190190 collectionsDB .put (data )
191- return redirect (f"{ path } { host } /collection/" + id + "/edit" )
191+ return redirect (f"/collection/" + id + "/edit" )
192192
193193@app .route ('/collection/<id>/delete' , methods = ['GET' ])
194194def collectionDelete (id ):
195195 collectionsDB .delete (id )
196- return redirect (f"{ path } { host } /" )
196+ return redirect (f"/" )
197197
198198
199199@app .route ('/content/<id>/delete' , methods = ['GET' ])
200200def contentDelete (id ):
201201 contentData = contentDB .get (id )
202202 contentDB .delete (id )
203- return redirect (f"{ path } { host } /collection/" + contentData ['collectionKey' ])
203+ return redirect (f"/collection/" + contentData ['collectionKey' ])
204204
205205
206206@app .route ('/content/<id>' , methods = ['GET' , 'POST' ])
@@ -240,7 +240,7 @@ def content(id):
240240 contentArray = list (content .items ())
241241 contentDB .update ({'content' : content , 'published' : published , 'title' : title , 'titleCaps' : title .upper (),
242242 "lastUpdated" : str (datetime .datetime .now (utc ))}, id )
243- return redirect (f"{ path } { host } /collection/{ contentData ['collectionKey' ]} " )
243+ return redirect (f"/collection/{ contentData ['collectionKey' ]} " )
244244 getContentData = contentDB .get (id )
245245 getCollectionData = collectionsDB .get (getContentData ['collectionKey' ])
246246 getContent = getContentData ['content' ]
@@ -280,7 +280,7 @@ def newContent(id):
280280 res = contentDB .insert (
281281 {"collectionKey" : id , "content" : {}, "title" : "Unnamed Content" , "published" : False , "lastUpdated" : str (datetime .datetime .now (utc ))})
282282 print (res )
283- return redirect (f"{ path } { host } /content/" + res ['key' ])
283+ return redirect (f"/content/" + res ['key' ])
284284
285285
286286@app .route ('/api/content/<id>' , methods = ['GET' ])
0 commit comments