1
Fork 0
mirror of https://github.com/Steffo99/sophon.git synced 2024-12-22 06:44:21 +00:00

🔧 Display user-friendly name for ResearchProjects

This commit is contained in:
Steffo 2021-09-01 17:23:00 +02:00
parent ae94259e38
commit f7144f1cd8

View file

@ -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}"