From b5a0598843ef65a58f21fdfae5fba14de46ae55b Mon Sep 17 00:00:00 2001 From: Shrikrishna Singh Date: Thu, 9 Apr 2020 04:51:22 +0530 Subject: [PATCH 01/15] Bump Django version to 1.11.17 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 12db2c8b..2b004666 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -Django==1.9 +Django==1.11.17 celery==3.1.20 djangorestframework==3.4 django-filter==1.0.1 From aae29e6c65ec3976026290770104c3a81db137b8 Mon Sep 17 00:00:00 2001 From: Shrikrishna Singh Date: Thu, 9 Apr 2020 04:55:38 +0530 Subject: [PATCH 02/15] Use Django's UUIDField instead of uuidfield package --- junction/devices/migrations/0001_initial.py | 8 +------- junction/devices/models.py | 4 +--- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/junction/devices/migrations/0001_initial.py b/junction/devices/migrations/0001_initial.py index 10d09b29..58927534 100644 --- a/junction/devices/migrations/0001_initial.py +++ b/junction/devices/migrations/0001_initial.py @@ -1,7 +1,6 @@ # -*- coding: utf-8 -*- from __future__ import unicode_literals -import uuidfield.fields from django.db import migrations, models import junction.devices.models @@ -34,12 +33,7 @@ class Migration(migrations.Migration): auto_now=True, verbose_name="Last Modified At" ), ), - ( - "uuid", - uuidfield.fields.UUIDField( - unique=True, max_length=32, db_index=True - ), - ), + ('uuid', models.UUIDField(max_length=32, unique=True, db_index=True)), ("is_verified", models.BooleanField(default=False)), ("verification_code", models.IntegerField()), ( diff --git a/junction/devices/models.py b/junction/devices/models.py index 4f4effc0..10a53b4e 100644 --- a/junction/devices/models.py +++ b/junction/devices/models.py @@ -1,10 +1,8 @@ # -*- coding: utf-8 -*- - import datetime from django.db import models from django.utils.timezone import now -from uuidfield import UUIDField from junction.base.models import TimeAuditModel @@ -14,7 +12,7 @@ def expiry_time(expiry_mins=60): class Device(TimeAuditModel): - uuid = UUIDField(version=1, hyphenate=True, unique=True, db_index=True) + uuid = models.UUIDField(unique=True, max_length=32, db_index=True) # Verification is_verified = models.BooleanField(default=False) From 457b00d2b77739881ec27411da8880cfd188eb04 Mon Sep 17 00:00:00 2001 From: Shrikrishna Singh Date: Thu, 9 Apr 2020 04:58:55 +0530 Subject: [PATCH 03/15] Bump django-pagedown version to 1.0.6 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 2b004666..62d65317 100644 --- a/requirements.txt +++ b/requirements.txt @@ -46,7 +46,7 @@ django-flat-theme==1.1.3 # Markdown Editor # ------------------------------------------------- django-markdown==0.8.4 -django-pagedown==0.1. +django-pagedown==1.0.6 mdx-linkify==0.6 Markdown==2.6.6 markdown2==2.3.1 From e6dcbf4f374825cfb7d434719b93ba7a45c10471 Mon Sep 17 00:00:00 2001 From: Shrikrishna Singh Date: Thu, 9 Apr 2020 05:01:08 +0530 Subject: [PATCH 04/15] Fix RadioSelect object has no attribute renderer --- junction/proposals/forms.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/junction/proposals/forms.py b/junction/proposals/forms.py index 07b6f7ed..6b7b736a 100644 --- a/junction/proposals/forms.py +++ b/junction/proposals/forms.py @@ -66,7 +66,7 @@ def _get_proposal_section_reviewer_vote_choices(conference): return values -class HorizRadioRenderer(forms.RadioSelect.renderer): +class HorizRadioRenderer(forms.RadioSelect): """ This overrides widget method to put radio buttons horizontally instead of vertically. From 60ee397928bf338bb63c938b1f180fe0b7dbe903 Mon Sep 17 00:00:00 2001 From: Shrikrishna Singh Date: Thu, 9 Apr 2020 05:11:07 +0530 Subject: [PATCH 05/15] Use django-markdown-app as django-markdown is not maintained --- requirements.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index 62d65317..a49cff6a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -45,10 +45,10 @@ django-flat-theme==1.1.3 # Markdown Editor # ------------------------------------------------- -django-markdown==0.8.4 +django-markdown-app==0.9.3.1 django-pagedown==1.0.6 mdx-linkify==0.6 -Markdown==2.6.6 +Markdown==2.6.7 markdown2==2.3.1 # Server From 00debdeb3c38a30bec789b70076e790ed1f33ab4 Mon Sep 17 00:00:00 2001 From: Shrikrishna Singh Date: Thu, 9 Apr 2020 05:17:12 +0530 Subject: [PATCH 06/15] Bump djangorestframework to 3.11.0 and django-filter to 2.2.0 --- junction/conferences/views.py | 7 +++++-- junction/proposals/views.py | 6 ++++-- junction/schedule/views.py | 6 ++++-- requirements.txt | 4 ++-- settings/common.py | 4 ---- 5 files changed, 15 insertions(+), 12 deletions(-) diff --git a/junction/conferences/views.py b/junction/conferences/views.py index 06107676..f46e4042 100644 --- a/junction/conferences/views.py +++ b/junction/conferences/views.py @@ -5,7 +5,10 @@ from django.http.response import HttpResponseRedirect from django.shortcuts import get_object_or_404 from django.views.decorators.http import require_http_methods -from rest_framework import filters, viewsets + +from django_filters import rest_framework as filters + +from rest_framework import viewsets from .models import Conference, ConferenceVenue, Room from .serializers import ConferenceSerializer, RoomSerializer, VenueSerializer @@ -25,7 +28,7 @@ class RoomView(viewsets.ReadOnlyModelViewSet): queryset = Room.objects.all() serializer_class = RoomSerializer filter_backend = (filters.DjangoFilterBackend,) - filter_fields = ("venue",) + filterset_fields = ("venue",) @require_http_methods(["GET"]) diff --git a/junction/proposals/views.py b/junction/proposals/views.py index d5862751..b8e2fcf4 100644 --- a/junction/proposals/views.py +++ b/junction/proposals/views.py @@ -12,9 +12,11 @@ from django.shortcuts import get_object_or_404, render from django.views.decorators.http import require_http_methods from hashids import Hashids -from rest_framework import filters, viewsets +from rest_framework import viewsets from rest_framework.response import Response +from django_filters import rest_framework as filters + from junction.base.constants import ( ConferenceSettingConstants, ConferenceStatus, @@ -39,7 +41,7 @@ class ProposalView(viewsets.ReadOnlyModelViewSet): queryset = Proposal.objects.filter(status=2) serializer_class = serializers.ProposalSerializer filter_backend = (filters.DjangoFilterBackend,) - filter_fields = ("conference", "review_status", "proposal_type", "proposal_section") + filterset_fields = ("conference", "review_status", "proposal_type", "proposal_section") def get_queryset(self): data = super(ProposalView, self).get_queryset() diff --git a/junction/schedule/views.py b/junction/schedule/views.py index a2c204fa..3e09e503 100644 --- a/junction/schedule/views.py +++ b/junction/schedule/views.py @@ -6,9 +6,11 @@ from django.http import HttpResponse from django.shortcuts import Http404, render from django.template.loader import render_to_string -from rest_framework import filters, viewsets +from rest_framework import viewsets from rest_framework.response import Response +from django_filters import rest_framework as filters + from .models import ScheduleItem from .serializers import ScheduleSerializer @@ -17,7 +19,7 @@ class ScheduleView(viewsets.ReadOnlyModelViewSet): queryset = ScheduleItem.objects.all() serializer_class = ScheduleSerializer filter_backend = (filters.DjangoFilterBackend,) - filter_fields = ("room", "conference", "event_date") + filterset_fields = ("room", "conference", "event_date") def get_queryset(self): data = ( diff --git a/requirements.txt b/requirements.txt index a49cff6a..f0566b0a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ Django==1.11.17 celery==3.1.20 -djangorestframework==3.4 -django-filter==1.0.1 +djangorestframework==3.11.0 +django-filter==2.2.0 # Persistent Store # ------------------------------------------------- diff --git a/settings/common.py b/settings/common.py index 36d473d3..9f16c156 100644 --- a/settings/common.py +++ b/settings/common.py @@ -214,10 +214,6 @@ # Make sure DB request held on for minimim 5 minutes CONN_MAX_AGE = 300 -REST_FRAMEWORK = { - "DEFAULT_FILTER_BACKENDS": ("rest_framework.filters.DjangoFilterBackend",) -} - EXPLARA_API_TOKEN = "shjbalkfbdskjlbdskljbdskaljfb" QR_CODES_DIR = ROOT_DIR + "/qr_files" From eaaf467d7cad04a5f5aecfa9593be37df1eb1544 Mon Sep 17 00:00:00 2001 From: Shrikrishna Singh Date: Thu, 9 Apr 2020 05:21:02 +0530 Subject: [PATCH 07/15] Bump celery version to 4.4.2 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index f0566b0a..271f7aef 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ Django==1.11.17 -celery==3.1.20 +celery==4.4.2 djangorestframework==3.11.0 django-filter==2.2.0 From 51129d7cd835191a07e0060f2dd3228aa27ab6df Mon Sep 17 00:00:00 2001 From: Shrikrishna Singh Date: Thu, 9 Apr 2020 05:22:21 +0530 Subject: [PATCH 08/15] Bump django-simple-history version to 2.8.0 --- .../migrations/0016_auto_20200410_1926.py | 32 ++++++++++++ .../migrations/0028_auto_20200507_1202.py | 52 +++++++++++++++++++ requirements.txt | 2 +- 3 files changed, 85 insertions(+), 1 deletion(-) create mode 100644 junction/conferences/migrations/0016_auto_20200410_1926.py create mode 100644 junction/proposals/migrations/0028_auto_20200507_1202.py diff --git a/junction/conferences/migrations/0016_auto_20200410_1926.py b/junction/conferences/migrations/0016_auto_20200410_1926.py new file mode 100644 index 00000000..c989aabf --- /dev/null +++ b/junction/conferences/migrations/0016_auto_20200410_1926.py @@ -0,0 +1,32 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.17 on 2020-04-10 13:56 +from __future__ import unicode_literals + +from django.conf import settings +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('conferences', '0015_auto_20200322_1904'), + ] + + operations = [ + migrations.AddField( + model_name='historicalconferenceproposalreviewer', + name='history_change_reason', + field=models.CharField(max_length=100, null=True), + ), + migrations.AlterField( + model_name='historicalconferenceproposalreviewer', + name='created_by', + field=models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to=settings.AUTH_USER_MODEL, verbose_name='Created By'), + ), + migrations.AlterField( + model_name='historicalconferenceproposalreviewer', + name='modified_by', + field=models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to=settings.AUTH_USER_MODEL, verbose_name='Modified By'), + ), + ] diff --git a/junction/proposals/migrations/0028_auto_20200507_1202.py b/junction/proposals/migrations/0028_auto_20200507_1202.py new file mode 100644 index 00000000..ee1e505f --- /dev/null +++ b/junction/proposals/migrations/0028_auto_20200507_1202.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.17 on 2020-05-07 06:32 +from __future__ import unicode_literals + +from django.conf import settings +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('proposals', '0027_auto_20200502_0540'), + ] + + operations = [ + migrations.AddField( + model_name='historicalproposal', + name='history_change_reason', + field=models.CharField(max_length=100, null=True), + ), + migrations.AddField( + model_name='historicalproposalsectionreviewervote', + name='history_change_reason', + field=models.CharField(max_length=100, null=True), + ), + migrations.AlterField( + model_name='historicalproposal', + name='author', + field=models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to=settings.AUTH_USER_MODEL, verbose_name='Primary Speaker'), + ), + migrations.AlterField( + model_name='historicalproposal', + name='proposal_section', + field=models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='proposals.ProposalSection', verbose_name='Proposal Section'), + ), + migrations.AlterField( + model_name='historicalproposal', + name='proposal_type', + field=models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='proposals.ProposalType', verbose_name='Proposal Type'), + ), + migrations.AlterField( + model_name='historicalproposal', + name='video_url', + field=models.URLField(blank=True, default='', help_text='Short 1-2 min video describing your talk'), + ), + migrations.AlterField( + model_name='proposal', + name='video_url', + field=models.URLField(blank=True, default='', help_text='Short 1-2 min video describing your talk'), + ), + ] diff --git a/requirements.txt b/requirements.txt index 271f7aef..91eeead2 100644 --- a/requirements.txt +++ b/requirements.txt @@ -35,7 +35,7 @@ mock==2.0.0 # Django all auth needs # Admin # ------------------------------------------------- -django_simple_history==1.8.0 +django_simple_history==2.8.0 # Frontend Helpers # ------------------------------------------------- From 7f6c38fe774338f725e179ae91fb5cd46b5e8cee Mon Sep 17 00:00:00 2001 From: Shrikrishna Singh Date: Thu, 9 Apr 2020 05:27:44 +0530 Subject: [PATCH 09/15] Bump django-bootstrap3 to 11.0.0 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 91eeead2..38be94a9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -39,7 +39,7 @@ django_simple_history==2.8.0 # Frontend Helpers # ------------------------------------------------- -django-bootstrap3==7.1.0 +django-bootstrap3==11.0.0 django-bootstrap-breadcrumbs==0.8 django-flat-theme==1.1.3 From 414ad279878f527edb3a5378525fb4039f960cc9 Mon Sep 17 00:00:00 2001 From: Shrikrishna Singh Date: Thu, 9 Apr 2020 05:29:24 +0530 Subject: [PATCH 10/15] Bump django-bootstrap-breadcrumbs version to 0.9.2 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 38be94a9..83f0aaa8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -40,7 +40,7 @@ django_simple_history==2.8.0 # Frontend Helpers # ------------------------------------------------- django-bootstrap3==11.0.0 -django-bootstrap-breadcrumbs==0.8 +django-bootstrap-breadcrumbs==0.9.2 django-flat-theme==1.1.3 # Markdown Editor From ff2a49921a76d3ea86d77b982497c84c8e2a644d Mon Sep 17 00:00:00 2001 From: Shrikrishna Singh Date: Thu, 9 Apr 2020 05:30:53 +0530 Subject: [PATCH 11/15] Use template context_processors instead of core --- settings/dev.py.sample | 2 +- settings/test_settings.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/settings/dev.py.sample b/settings/dev.py.sample index 8d6455a0..d41d0829 100644 --- a/settings/dev.py.sample +++ b/settings/dev.py.sample @@ -18,7 +18,7 @@ DATABASES = { ACCOUNT_DEFAULT_HTTP_PROTOCOL = 'http' TEMPLATES[0]['OPTIONS']['context_processors'].extend([ - "django.core.context_processors.debug", + "django.template.context_processors.debug", ]) EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' diff --git a/settings/test_settings.py b/settings/test_settings.py index eb331501..78e09c47 100644 --- a/settings/test_settings.py +++ b/settings/test_settings.py @@ -16,7 +16,7 @@ } TEMPLATES[0]["OPTIONS"]["context_processors"].extend( - ["django.core.context_processors.debug",] + ["django.template.context_processors.debug",] ) EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend" From 207087dccba7d3c092e5687edf1dda4357c449a2 Mon Sep 17 00:00:00 2001 From: Shrikrishna Singh Date: Thu, 9 Apr 2020 05:32:48 +0530 Subject: [PATCH 12/15] Use user.is_authenticated as property --- junction/conferences/permissions.py | 2 +- junction/proposals/permissions.py | 6 +++--- junction/proposals/views.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/junction/conferences/permissions.py b/junction/conferences/permissions.py index 6e4fdc34..ab00abce 100644 --- a/junction/conferences/permissions.py +++ b/junction/conferences/permissions.py @@ -6,7 +6,7 @@ def is_reviewer(user, conference): """Returns a boolean indicating if a given user is a conference reviewer. """ - if not user.is_authenticated(): + if not user.is_authenticated: return False qs = ConferenceProposalReviewer.objects.filter( diff --git a/junction/proposals/permissions.py b/junction/proposals/permissions.py index ee316880..8d678809 100644 --- a/junction/proposals/permissions.py +++ b/junction/proposals/permissions.py @@ -13,11 +13,11 @@ def is_proposal_voting_allowed(proposal): def is_proposal_author(user, proposal): - return user.is_authenticated() and proposal.author == user + return user.is_authenticated and proposal.author == user def is_proposal_reviewer(user, conference): - authenticated = user.is_authenticated() + authenticated = user.is_authenticated is_reviewer = ConferenceProposalReviewer.objects.filter( reviewer=user.id, conference=conference, active=True ).exists() @@ -26,7 +26,7 @@ def is_proposal_reviewer(user, conference): def is_proposal_section_reviewer(user, conference, proposal): return ( - user.is_authenticated() + user.is_authenticated and ProposalSectionReviewer.objects.filter( conference_reviewer__reviewer=user, conference_reviewer__conference=conference, diff --git a/junction/proposals/views.py b/junction/proposals/views.py index b8e2fcf4..9152f610 100644 --- a/junction/proposals/views.py +++ b/junction/proposals/views.py @@ -235,7 +235,7 @@ def detail_proposal(request, conference_slug, slug, hashid=None): if public_voting_setting: public_voting_setting_value = public_voting_setting.value try: - if request.user.is_authenticated(): + if request.user.is_authenticated: proposal_vote = ProposalVote.objects.get( proposal=proposal, voter=request.user ) From cd194699ccd5ecc68475229cea0c85059b4d1e1d Mon Sep 17 00:00:00 2001 From: Shrikrishna Singh Date: Thu, 9 Apr 2020 05:34:53 +0530 Subject: [PATCH 13/15] Bump pytest-django version to 3.9.0 --- tools/requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/requirements-test.txt b/tools/requirements-test.txt index c0eae20c..10f8091b 100644 --- a/tools/requirements-test.txt +++ b/tools/requirements-test.txt @@ -1,6 +1,6 @@ factory-boy==2.11.1 -pytest-django==3.4.8 +pytest-django==3.9.0 pytest-cov==2.6.1 coverage==5.0.4 From e3b06cfb317f532757fa20262b9ca432b1a2be06 Mon Sep 17 00:00:00 2001 From: Shrikrishna Singh Date: Fri, 10 Apr 2020 19:29:17 +0530 Subject: [PATCH 14/15] Lint the code --- .../migrations/0016_auto_20200410_1926.py | 36 ++++++--- junction/conferences/views.py | 2 - junction/devices/migrations/0001_initial.py | 2 +- .../migrations/0028_auto_20200507_1202.py | 74 +++++++++++++------ junction/proposals/views.py | 10 ++- junction/schedule/views.py | 3 +- 6 files changed, 88 insertions(+), 39 deletions(-) diff --git a/junction/conferences/migrations/0016_auto_20200410_1926.py b/junction/conferences/migrations/0016_auto_20200410_1926.py index c989aabf..bfcdfd5b 100644 --- a/junction/conferences/migrations/0016_auto_20200410_1926.py +++ b/junction/conferences/migrations/0016_auto_20200410_1926.py @@ -2,31 +2,47 @@ # Generated by Django 1.11.17 on 2020-04-10 13:56 from __future__ import unicode_literals +import django.db.models.deletion from django.conf import settings from django.db import migrations, models -import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ - ('conferences', '0015_auto_20200322_1904'), + ("conferences", "0015_auto_20200322_1904"), ] operations = [ migrations.AddField( - model_name='historicalconferenceproposalreviewer', - name='history_change_reason', + model_name="historicalconferenceproposalreviewer", + name="history_change_reason", field=models.CharField(max_length=100, null=True), ), migrations.AlterField( - model_name='historicalconferenceproposalreviewer', - name='created_by', - field=models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to=settings.AUTH_USER_MODEL, verbose_name='Created By'), + model_name="historicalconferenceproposalreviewer", + name="created_by", + field=models.ForeignKey( + blank=True, + db_constraint=False, + null=True, + on_delete=django.db.models.deletion.DO_NOTHING, + related_name="+", + to=settings.AUTH_USER_MODEL, + verbose_name="Created By", + ), ), migrations.AlterField( - model_name='historicalconferenceproposalreviewer', - name='modified_by', - field=models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to=settings.AUTH_USER_MODEL, verbose_name='Modified By'), + model_name="historicalconferenceproposalreviewer", + name="modified_by", + field=models.ForeignKey( + blank=True, + db_constraint=False, + null=True, + on_delete=django.db.models.deletion.DO_NOTHING, + related_name="+", + to=settings.AUTH_USER_MODEL, + verbose_name="Modified By", + ), ), ] diff --git a/junction/conferences/views.py b/junction/conferences/views.py index f46e4042..af0e4f97 100644 --- a/junction/conferences/views.py +++ b/junction/conferences/views.py @@ -5,9 +5,7 @@ from django.http.response import HttpResponseRedirect from django.shortcuts import get_object_or_404 from django.views.decorators.http import require_http_methods - from django_filters import rest_framework as filters - from rest_framework import viewsets from .models import Conference, ConferenceVenue, Room diff --git a/junction/devices/migrations/0001_initial.py b/junction/devices/migrations/0001_initial.py index 58927534..5d4121cc 100644 --- a/junction/devices/migrations/0001_initial.py +++ b/junction/devices/migrations/0001_initial.py @@ -33,7 +33,7 @@ class Migration(migrations.Migration): auto_now=True, verbose_name="Last Modified At" ), ), - ('uuid', models.UUIDField(max_length=32, unique=True, db_index=True)), + ("uuid", models.UUIDField(max_length=32, unique=True, db_index=True)), ("is_verified", models.BooleanField(default=False)), ("verification_code", models.IntegerField()), ( diff --git a/junction/proposals/migrations/0028_auto_20200507_1202.py b/junction/proposals/migrations/0028_auto_20200507_1202.py index ee1e505f..382ebf50 100644 --- a/junction/proposals/migrations/0028_auto_20200507_1202.py +++ b/junction/proposals/migrations/0028_auto_20200507_1202.py @@ -2,51 +2,83 @@ # Generated by Django 1.11.17 on 2020-05-07 06:32 from __future__ import unicode_literals +import django.db.models.deletion from django.conf import settings from django.db import migrations, models -import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ - ('proposals', '0027_auto_20200502_0540'), + ("proposals", "0027_auto_20200502_0540"), ] operations = [ migrations.AddField( - model_name='historicalproposal', - name='history_change_reason', + model_name="historicalproposal", + name="history_change_reason", field=models.CharField(max_length=100, null=True), ), migrations.AddField( - model_name='historicalproposalsectionreviewervote', - name='history_change_reason', + model_name="historicalproposalsectionreviewervote", + name="history_change_reason", field=models.CharField(max_length=100, null=True), ), migrations.AlterField( - model_name='historicalproposal', - name='author', - field=models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to=settings.AUTH_USER_MODEL, verbose_name='Primary Speaker'), + model_name="historicalproposal", + name="author", + field=models.ForeignKey( + blank=True, + db_constraint=False, + null=True, + on_delete=django.db.models.deletion.DO_NOTHING, + related_name="+", + to=settings.AUTH_USER_MODEL, + verbose_name="Primary Speaker", + ), ), migrations.AlterField( - model_name='historicalproposal', - name='proposal_section', - field=models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='proposals.ProposalSection', verbose_name='Proposal Section'), + model_name="historicalproposal", + name="proposal_section", + field=models.ForeignKey( + blank=True, + db_constraint=False, + null=True, + on_delete=django.db.models.deletion.DO_NOTHING, + related_name="+", + to="proposals.ProposalSection", + verbose_name="Proposal Section", + ), ), migrations.AlterField( - model_name='historicalproposal', - name='proposal_type', - field=models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='proposals.ProposalType', verbose_name='Proposal Type'), + model_name="historicalproposal", + name="proposal_type", + field=models.ForeignKey( + blank=True, + db_constraint=False, + null=True, + on_delete=django.db.models.deletion.DO_NOTHING, + related_name="+", + to="proposals.ProposalType", + verbose_name="Proposal Type", + ), ), migrations.AlterField( - model_name='historicalproposal', - name='video_url', - field=models.URLField(blank=True, default='', help_text='Short 1-2 min video describing your talk'), + model_name="historicalproposal", + name="video_url", + field=models.URLField( + blank=True, + default="", + help_text="Short 1-2 min video describing your talk", + ), ), migrations.AlterField( - model_name='proposal', - name='video_url', - field=models.URLField(blank=True, default='', help_text='Short 1-2 min video describing your talk'), + model_name="proposal", + name="video_url", + field=models.URLField( + blank=True, + default="", + help_text="Short 1-2 min video describing your talk", + ), ), ] diff --git a/junction/proposals/views.py b/junction/proposals/views.py index 9152f610..5a1d5cc9 100644 --- a/junction/proposals/views.py +++ b/junction/proposals/views.py @@ -11,12 +11,11 @@ from django.http.response import HttpResponse, HttpResponseRedirect from django.shortcuts import get_object_or_404, render from django.views.decorators.http import require_http_methods +from django_filters import rest_framework as filters from hashids import Hashids from rest_framework import viewsets from rest_framework.response import Response -from django_filters import rest_framework as filters - from junction.base.constants import ( ConferenceSettingConstants, ConferenceStatus, @@ -41,7 +40,12 @@ class ProposalView(viewsets.ReadOnlyModelViewSet): queryset = Proposal.objects.filter(status=2) serializer_class = serializers.ProposalSerializer filter_backend = (filters.DjangoFilterBackend,) - filterset_fields = ("conference", "review_status", "proposal_type", "proposal_section") + filterset_fields = ( + "conference", + "review_status", + "proposal_type", + "proposal_section", + ) def get_queryset(self): data = super(ProposalView, self).get_queryset() diff --git a/junction/schedule/views.py b/junction/schedule/views.py index 3e09e503..a8ff827f 100644 --- a/junction/schedule/views.py +++ b/junction/schedule/views.py @@ -6,11 +6,10 @@ from django.http import HttpResponse from django.shortcuts import Http404, render from django.template.loader import render_to_string +from django_filters import rest_framework as filters from rest_framework import viewsets from rest_framework.response import Response -from django_filters import rest_framework as filters - from .models import ScheduleItem from .serializers import ScheduleSerializer From 8d78d59ee7142a24d4af1eccfb8b7aff62548673 Mon Sep 17 00:00:00 2001 From: Shrikrishna Singh Date: Fri, 10 Apr 2020 20:39:03 +0530 Subject: [PATCH 15/15] Fix ticket model __str__ method --- junction/tickets/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/junction/tickets/models.py b/junction/tickets/models.py index 506de26d..c775c037 100644 --- a/junction/tickets/models.py +++ b/junction/tickets/models.py @@ -24,4 +24,4 @@ class Ticket(AuditModel): others = JSONField() def __str__(self): - return self.name, self.email, self.ticket_no + return "{} : {} : {}".format(self.name, self.email, self.ticket_no)