Compare commits
No commits in common. "f6c4c732d6971ad8248843e186eff23f78a37686" and "d937804737cfd59f4751a0ac6917d1eb58cce5bf" have entirely different histories.
f6c4c732d6
...
d937804737
4 changed files with 6 additions and 30 deletions
|
@ -4,7 +4,6 @@
|
||||||
|
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<h2>Bank</h2>
|
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-header d-flex">
|
<div class="card-header d-flex">
|
||||||
<div class="nav nav-tabs card-header-tabs mr-auto">
|
<div class="nav nav-tabs card-header-tabs mr-auto">
|
||||||
|
|
|
@ -1,21 +0,0 @@
|
||||||
# Generated by Django 3.0.2 on 2020-04-17 08:54
|
|
||||||
|
|
||||||
from django.conf import settings
|
|
||||||
from django.db import migrations, models
|
|
||||||
import django.db.models.deletion
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
|
||||||
|
|
||||||
dependencies = [
|
|
||||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
|
||||||
('raids', '0005_auto_20200106_2305'),
|
|
||||||
]
|
|
||||||
|
|
||||||
operations = [
|
|
||||||
migrations.AlterField(
|
|
||||||
model_name='raidcomment',
|
|
||||||
name='user',
|
|
||||||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='raid_comments', to=settings.AUTH_USER_MODEL),
|
|
||||||
),
|
|
||||||
]
|
|
|
@ -141,7 +141,7 @@ class RaidComment(models.Model):
|
||||||
user = models.ForeignKey(
|
user = models.ForeignKey(
|
||||||
settings.AUTH_USER_MODEL,
|
settings.AUTH_USER_MODEL,
|
||||||
related_name="raid_comments",
|
related_name="raid_comments",
|
||||||
on_delete=models.CASCADE,
|
on_delete=models.PROTECT,
|
||||||
)
|
)
|
||||||
|
|
||||||
body = models.TextField(
|
body = models.TextField(
|
||||||
|
|
|
@ -19,7 +19,6 @@ User = get_user_model()
|
||||||
|
|
||||||
|
|
||||||
class RaidCalendar(MonthArchiveView):
|
class RaidCalendar(MonthArchiveView):
|
||||||
queryset = Raid.objects.all()
|
|
||||||
allow_empty = True
|
allow_empty = True
|
||||||
allow_future = True
|
allow_future = True
|
||||||
date_field = "date"
|
date_field = "date"
|
||||||
|
@ -28,12 +27,11 @@ class RaidCalendar(MonthArchiveView):
|
||||||
template_name_suffix = "_calendar"
|
template_name_suffix = "_calendar"
|
||||||
|
|
||||||
def get_queryset(self):
|
def get_queryset(self):
|
||||||
queryset = super().get_queryset()
|
if not self.request.user.is_authenticated:
|
||||||
if self.request.user.is_authenticated:
|
return Raid.objects.all()
|
||||||
queryset = queryset.annotate(
|
return Raid.objects.annotate(
|
||||||
max_status=Max("responses__status", filter=Q(responses__character__user=self.request.user))
|
max_status=Max("responses__status", filter=Q(responses__character__user=self.request.user))
|
||||||
)
|
)
|
||||||
return queryset
|
|
||||||
|
|
||||||
def get_dated_queryset(self, **lookup):
|
def get_dated_queryset(self, **lookup):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Add table
Reference in a new issue