File tree Expand file tree Collapse file tree 3 files changed +24
-3
lines changed Expand file tree Collapse file tree 3 files changed +24
-3
lines changed Original file line number Diff line number Diff line change 1+ # Generated by Django 2.0.5 on 2018-08-12 18:39
2+
3+ from django .db import migrations , models
4+
5+
6+ class Migration (migrations .Migration ):
7+
8+ dependencies = [
9+ ('cfp' , '0009_auto_20180810_1859' ),
10+ ]
11+
12+ operations = [
13+ migrations .AddField (
14+ model_name = 'cfp' ,
15+ name = 'active' ,
16+ field = models .BooleanField (default = True ),
17+ preserve_default = False
18+ ),
19+ ]
Original file line number Diff line number Diff line change 1010from markdownx .utils import markdownify
1111from slugify import slugify
1212from taggit .managers import TaggableManager
13+
14+ from pyconbalkan .core .models import ActiveModel
1315from . import const
1416
1517
16- class Cfp (models . Model ):
18+ class Cfp (ActiveModel ):
1719 name = models .CharField (max_length = 256 )
1820 company = models .CharField (max_length = 100 , null = True , blank = True )
1921 email = models .EmailField ()
Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ def cfp_view(request):
4141
4242@login_required
4343def cfp_list (request ):
44- cfps = Cfp .objects .annotate (
44+ cfps = Cfp .objects .filter ( active = True ). annotate (
4545 my_rating = Subquery (CFPRating .objects .filter (cfp = OuterRef ('pk' ), user = request .user ).values ('mark' ))
4646 )
4747
@@ -53,7 +53,7 @@ def cfp_list(request):
5353
5454@login_required
5555def cfp_detail (request , slug ):
56- cfp = get_object_or_404 (Cfp , slug = slug )
56+ cfp = get_object_or_404 (Cfp , slug = slug , active = True )
5757 ratings = CFPRating .objects .filter (cfp = cfp )
5858 context = {
5959 'cfp' : cfp ,
You can’t perform that action at this time.
0 commit comments