|
6 | 6 | from django.db import models |
7 | 7 | from django.db.models import UniqueConstraint |
8 | 8 |
|
9 | | - |
10 | 9 | from core.models import Like, View |
11 | 10 | from files.models import UserFile |
12 | 11 | from industries.models import Industry |
13 | | - |
14 | 12 | from projects.constants import VERBOSE_STEPS |
15 | 13 | from projects.managers import AchievementManager, CollaboratorManager, ProjectManager |
16 | 14 | from users.models import CustomUser |
@@ -55,7 +53,11 @@ def get_random_file(cls): |
55 | 53 | @classmethod |
56 | 54 | def get_random_file_link(cls): |
57 | 55 | # FIXME: this is not efficient, but for ~10 default covers it should be ok |
58 | | - return cls.objects.order_by("?").first().image.link if cls.objects.order_by("?").first().image else None |
| 56 | + return ( |
| 57 | + cls.objects.order_by("?").first().image.link |
| 58 | + if cls.objects.order_by("?").first().image |
| 59 | + else None |
| 60 | + ) |
59 | 61 |
|
60 | 62 | class Meta: |
61 | 63 | verbose_name = "Обложка проекта" |
@@ -87,7 +89,9 @@ class Project(models.Model): |
87 | 89 | name = models.CharField(max_length=256, null=True, blank=True) |
88 | 90 | description = models.TextField(null=True, blank=True) |
89 | 91 | region = models.CharField(max_length=256, null=True, blank=True) |
90 | | - step = models.PositiveSmallIntegerField(choices=VERBOSE_STEPS, null=True, blank=True) |
| 92 | + step = models.PositiveSmallIntegerField( |
| 93 | + choices=VERBOSE_STEPS, null=True, blank=True |
| 94 | + ) |
91 | 95 | hidden_score = models.PositiveSmallIntegerField(default=100) |
92 | 96 |
|
93 | 97 | track = models.CharField( |
|
0 commit comments