1
Fork 0
mirror of https://github.com/Steffo99/sophon.git synced 2025-01-10 07:49:46 +00:00

🔧 Display user-friendly name for ResearchProjects

This commit is contained in:
Steffo 2021-09-01 17:23:00 +02:00
parent f46022d4f5
commit 7b3631eed5
Signed by: steffo
GPG key ID: 6965406171929D01

View file

@ -45,6 +45,13 @@ class ResearchProject(SophonGroupModel):
max_length=16, max_length=16,
) )
def get_visibility_emoji(self):
return {
"PUBLIC": "🌍",
"INTERNAL": "🏭",
"PRIVATE": "🔒",
}[self.visibility]
def get_group(self) -> ResearchGroup: def get_group(self) -> ResearchGroup:
return self.group return self.group
@ -81,3 +88,6 @@ class ResearchProject(SophonGroupModel):
"description", "description",
"visibility", "visibility",
} }
def __str__(self):
return f"{self.get_visibility_emoji()} {self.name}"