Skip to content

Commit 9ee3176

Browse files
authored
fix(core): skip fast cache migrations check for anonymous users (#3577)
1 parent 0c352d8 commit 9ee3176

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

renku/ui/service/controllers/cache_migrations_check.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,12 @@ def _fast_op_without_cache(self):
5454
if "git_url" not in self.context:
5555
raise RenkuException("context does not contain `git_url`")
5656

57+
token = self.user.token if hasattr(self, "user") else self.user_data.get("token")
58+
59+
if not token:
60+
# User isn't logged in, fast op doesn't work
61+
return None
62+
5763
with tempfile.TemporaryDirectory() as tempdir:
5864
tempdir_path = Path(tempdir)
5965
self.git_api_provider.download_files_from_api(
@@ -93,6 +99,9 @@ def to_response(self):
9399
except BaseException as e:
94100
service_log.info(f"fast gitlab checkout didnt work: {e}", exc_info=e)
95101
result = self.execute_op()
102+
else:
103+
if result is None:
104+
result = self.execute_op()
96105

97106
result_dict = asdict(result)
98107

0 commit comments

Comments
 (0)