mirror of
https://github.com/Steffo99/sophon.git
synced 2024-12-22 06:44:21 +00:00
🔧 Display user-friendly name for ResearchProject
s
This commit is contained in:
parent
ae94259e38
commit
f7144f1cd8
1 changed files with 10 additions and 0 deletions
|
@ -45,6 +45,13 @@ class ResearchProject(SophonGroupModel):
|
|||
max_length=16,
|
||||
)
|
||||
|
||||
def get_visibility_emoji(self):
|
||||
return {
|
||||
"PUBLIC": "🌍",
|
||||
"INTERNAL": "🏭",
|
||||
"PRIVATE": "🔒",
|
||||
}[self.visibility]
|
||||
|
||||
def get_group(self) -> ResearchGroup:
|
||||
return self.group
|
||||
|
||||
|
@ -81,3 +88,6 @@ class ResearchProject(SophonGroupModel):
|
|||
"description",
|
||||
"visibility",
|
||||
}
|
||||
|
||||
def __str__(self):
|
||||
return f"{self.get_visibility_emoji()} {self.name}"
|
||||
|
|
Loading…
Reference in a new issue