fix: lru_cache (#7)
This commit is contained in:
		
							parent
							
								
									8f4df00f92
								
							
						
					
					
						commit
						3a6399ea1c
					
				|  | @ -43,14 +43,14 @@ class Gitea: | ||||||
|         self.settings_api = focs_gitea.SettingsApi(self.api_client) |         self.settings_api = focs_gitea.SettingsApi(self.api_client) | ||||||
|         self.user_api = focs_gitea.UserApi(self.api_client) |         self.user_api = focs_gitea.UserApi(self.api_client) | ||||||
| 
 | 
 | ||||||
|     @lru_cache |     @lru_cache() | ||||||
|     def _get_team_id_by_name(self, name: str) -> int: |     def _get_team_id_by_name(self, name: str) -> int: | ||||||
|         res = self.organization_api.team_search(self.org_name, q=str(name), limit=1) |         res = self.organization_api.team_search(self.org_name, q=str(name), limit=1) | ||||||
|         if len(res["data"]) == 0: |         if len(res["data"]) == 0: | ||||||
|             raise Exception("Team not found by name") |             raise Exception("Team not found by name") | ||||||
|         return res["data"][0]["id"] |         return res["data"][0]["id"] | ||||||
| 
 | 
 | ||||||
|     @lru_cache |     @lru_cache() | ||||||
|     def _get_username_by_canvas_student(self, student: User) -> str: |     def _get_username_by_canvas_student(self, student: User) -> str: | ||||||
|         res = self.user_api.user_search(q=student.sis_login_id, limit=1) |         res = self.user_api.user_search(q=student.sis_login_id, limit=1) | ||||||
|         return res["data"][0]["username"] |         return res["data"][0]["username"] | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 GitHub
							GitHub