@@ -26,6 +26,7 @@ class SettingsForm(FlaskForm):
2626 @admin_only
2727 def setup (self ):
2828 if self .is_submitted ():
29+ step = 3
2930 try :
3031 settings = Settings .query .get (1 )
3132
@@ -41,16 +42,19 @@ def setup(self):
4142
4243 cache .delete (key = "past_running_time" )
4344 cache .delete (key = "settings" )
44- return redirect ( url_for ( "main.setup" , step = 3 ))
45+ step = 3
4546
4647 except SQLAlchemyError :
4748 db .session .rollback ()
4849 flash ("Transaction failed. Please try again." , "danger" )
49- return redirect ( url_for ( "main.setup" ), step = 2 )
50+ step = 2
5051
5152 else :
5253 flash ("Form validation failed. Please try again." , "danger" )
53- return redirect (url_for ("main.setup" , step = 2 ))
54+ step = 2
55+
56+ return redirect (url_for ("main.setup" ), step = step )
57+ # lgtm [py/call/wrong-named-argument]
5458
5559
5660class WebsiteForm (FlaskForm ):
@@ -86,8 +90,9 @@ def setup(self):
8690 except SQLAlchemyError :
8791 db .session .rollback ()
8892 flash ("Transaction failed. Please try again." , "danger" )
89- return redirect (url_for ("main.setup" ), step = 3 )
9093
9194 else :
9295 flash ("Error: Couldn't save form data." , "danger" )
93- return redirect (url_for ("main.setup" , step = 3 ))
96+
97+ return redirect (url_for ("main.setup" ), step = 3 )
98+ # lgtm [py/call/wrong-named-argument]
0 commit comments