We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ef61429 commit 24085f9Copy full SHA for 24085f9
1 file changed
projects/models.py
@@ -1,3 +1,5 @@
1
+from typing import Optional
2
+
3
from django.contrib.auth import get_user_model
4
from django.db import models
5
from django.db.models import UniqueConstraint
@@ -63,8 +65,8 @@ class Project(models.Model):
63
65
64
66
objects = ProjectManager()
67
- def get_short_description(self):
- return self.description[:30]
68
+ def get_short_description(self) -> Optional[str]:
69
+ return self.description[:30] if self.description else None
70
71
def __str__(self):
72
return f"Project<{self.id}> - {self.name}"
0 commit comments