Skip to content

Commit

Permalink
fix mypy issue
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinBelthle authored and laurent-laporte-pro committed Oct 9, 2023
1 parent 60c2fd6 commit 6627af2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions antarest/study/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
from antarest.core.utils.fastapi_sqlalchemy import db
from antarest.core.utils.utils import StopWatch
from antarest.login.model import Group
from antarest.login.service import LoginService, UserNotFoundError
from antarest.login.service import LoginService
from antarest.matrixstore.matrix_editor import MatrixEditInstruction
from antarest.study.business.adequacy_patch_management import AdequacyPatchManager
from antarest.study.business.advanced_parameters_management import AdvancedParamsManager
Expand Down Expand Up @@ -645,14 +645,14 @@ def get_user_name(self, params: RequestParameters) -> str:
Returns: The user's name
"""
author = "Unknown"
if params.user:
if params.user.type == "bots":
curr_user = self.user_service.get_user(params.user.impersonator, params)
else:
curr_user = self.user_service.get_user(params.user.id, params)
author = curr_user.to_dto().name
return author
if curr_user:
return curr_user.to_dto().name
return "Unknown"

def get_study_synthesis(self, study_id: str, params: RequestParameters) -> FileStudyTreeConfigDTO:
"""
Expand Down

0 comments on commit 6627af2

Please sign in to comment.