Skip to content

Commit

Permalink
Fix py/url-redirection by replacing request.referrer by get_redirect() (
Browse files Browse the repository at this point in the history
#34237)

* Fix py/url-redirection by replacing request.referrer by get_redirect()

* call update_redirect before redirect
  • Loading branch information
hussein-awala authored Sep 22, 2023
1 parent e76b505 commit c620e46
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion airflow/www/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -5162,7 +5162,8 @@ def varimport(self, session):
failed_repr = ", ".join(repr(k) for k in sorted(existing_keys))
flash(f"Failed. The variables with these keys: {failed_repr} already exists.")
logging.error(f"Failed. The variables with these keys: {failed_repr} already exists.")
return redirect(location=request.referrer)
self.update_redirect()
return redirect(self.get_redirect())
skipped = set()
suc_count = fail_count = 0
for k, v in variable_dict.items():
Expand Down

0 comments on commit c620e46

Please sign in to comment.