Skip to content

Commit d4f1aa0

Browse files
committed
Merge branch 'announcement-fix' into develop
2 parents 7132b7a + fe5f48b commit d4f1aa0

File tree

6 files changed

+8
-10
lines changed

6 files changed

+8
-10
lines changed

core/admin.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,8 @@ def get_readonly_fields(self, request, obj=None):
302302

303303
all_fields = [
304304
"organization",
305-
"organization_stringauthor",
305+
"organization_string",
306+
"author",
306307
"title",
307308
"body",
308309
"tags",

core/api/v3/objects/announcement.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ class Meta:
9696
"rejection_reason",
9797
"author",
9898
"organization",
99+
"organization_string",
99100
"supervisor",
100101
"tags",
101102
"likes",

core/models/post.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ def get_absolute_url(self):
291291

292292
@classmethod
293293
def get_approved(cls) -> QuerySet:
294-
return cls.objects.filter(status="a").filter(show_after__lte=timezone.now())
294+
return cls.objects.filter(status="a").filter(show_after__lte=timezone.now()).order_by("-show_after")
295295

296296
@classmethod
297297
def get_all(cls, user=None) -> QuerySet:

core/tasks.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def delete_expired_users():
8686
"""Scrub user data from inactive accounts that have not logged in for 14 days. (marked deleted)"""
8787
queryset = User.objects.filter(
8888
is_deleted=True,
89-
last_login__lt=dt.datetime.now() - dt.timedelta(days=14),
89+
last_login__lt=timezone.make_aware(dt.datetime.now() - dt.timedelta(days=14)),
9090
)
9191
comments = Comment.objects.filter(author__in=queryset)
9292
comments.update(
@@ -97,7 +97,7 @@ def delete_expired_users():
9797
last_name="User",
9898
username=get_random_username(),
9999
bio="",
100-
timezone="",
100+
# timezone="",
101101
graduating_year=None,
102102
is_teacher=False,
103103
organizations=[],

core/templates/core/announcement/card_snippet.html

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@ <h1 class="title">{{ announcement.title }}</h1>
2020
{% endif %}
2121
<div class="card-authors-text">
2222
{% if announcement.organization %}
23-
{{ announcement.organization.slug|organization }}
24-
{% else %}
25-
<span class="card-authors-text-string">{{ announcement.organization_string }}</span>{% endif %}{% if announcement.author %}, {{ announcement.author.username|user }}
23+
{{ announcement.organization.slug|organization }}{% else %}<span class="card-authors-text-string">{{ announcement.organization_string }}</span>{% endif %}{% if announcement.author %}, {{ announcement.author.username|user }}
2624
{% endif %}
2725
<br>
2826
<dot></dot> {{ announcement.created_date|date:"M. j, Y" }}{{ announcement.created_date|date:", g:i A"|lower }}

core/templates/core/announcement/detail.html

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,7 @@ <h1 class="title">{{ announcement.title }}</h1>
4848
{% endif %}
4949
<div class="card-authors-text">
5050
{% if announcement.organization %}
51-
{{ announcement.organization.slug|organization }},
52-
{% else %}
53-
<span class="card-authors-text-string">{{ announcement.organization_string }}</span>{% endif %}{% if announcement.author %}, {{ announcement.author.username|user }}
51+
{{ announcement.organization.slug|organization }}{% else %}<span class="card-authors-text-string">{{ announcement.organization_string }}</span>{% endif %}{% if announcement.author %}, {{ announcement.author.username|user }}
5452
{% endif %}
5553
<br>
5654
<dot></dot> {{ announcement.last_modified_date }}

0 commit comments

Comments
 (0)