From 48a0c6ab4fa50c61dbe07915c16c95d8a7bb3299 Mon Sep 17 00:00:00 2001 From: Kenan Wright Date: Fri, 4 Oct 2024 16:04:40 +0000 Subject: [PATCH] Resolved issues with PR --- docker-compose.yml | 2 - hackathon/forms.py | 10 ++--- hackathon/migrations/0049_event.py | 23 ---------- .../migrations/0050_auto_20240510_1722.py | 18 -------- .../migrations/0051_auto_20240510_1728.py | 42 ------------------- .../migrations/0052_auto_20240516_1847.py | 23 ---------- .../migrations/0053_auto_20240516_1850.py | 31 -------------- hackathon/migrations/0054_event.py | 28 +++++++++++++ hackathon/migrations/0054_event_category.py | 18 -------- .../migrations/0055_auto_20240516_2100.py | 18 -------- .../0056_event_google_calendar_link.py | 18 -------- .../migrations/0057_auto_20240910_2006.py | 23 ---------- .../migrations/0058_auto_20240910_2008.py | 18 -------- .../migrations/0059_auto_20240910_2010.py | 21 ---------- hackathon/migrations/0060_event_hackathon.py | 20 --------- .../0061_remove_event_calendar_id.py | 17 -------- .../migrations/0062_remove_event_category.py | 17 -------- .../migrations/0063_auto_20240915_1858.py | 18 -------- .../migrations/0064_event_webinar_code.py | 18 -------- .../migrations/0065_auto_20240916_1009.py | 18 -------- .../templates/hackathon/hackathon_events.html | 2 +- hackathon/urls.py | 2 - hackathon/views.py | 18 -------- 23 files changed, 32 insertions(+), 391 deletions(-) delete mode 100644 hackathon/migrations/0049_event.py delete mode 100644 hackathon/migrations/0050_auto_20240510_1722.py delete mode 100644 hackathon/migrations/0051_auto_20240510_1728.py delete mode 100644 hackathon/migrations/0052_auto_20240516_1847.py delete mode 100644 hackathon/migrations/0053_auto_20240516_1850.py create mode 100644 hackathon/migrations/0054_event.py delete mode 100644 hackathon/migrations/0054_event_category.py delete mode 100644 hackathon/migrations/0055_auto_20240516_2100.py delete mode 100644 hackathon/migrations/0056_event_google_calendar_link.py delete mode 100644 hackathon/migrations/0057_auto_20240910_2006.py delete mode 100644 hackathon/migrations/0058_auto_20240910_2008.py delete mode 100644 hackathon/migrations/0059_auto_20240910_2010.py delete mode 100644 hackathon/migrations/0060_event_hackathon.py delete mode 100644 hackathon/migrations/0061_remove_event_calendar_id.py delete mode 100644 hackathon/migrations/0062_remove_event_category.py delete mode 100644 hackathon/migrations/0063_auto_20240915_1858.py delete mode 100644 hackathon/migrations/0064_event_webinar_code.py delete mode 100644 hackathon/migrations/0065_auto_20240916_1009.py diff --git a/docker-compose.yml b/docker-compose.yml index 39232076..1f83bf32 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,5 +1,3 @@ -# version: "3.4" - services: hackathon-app: image: hackathon-app diff --git a/hackathon/forms.py b/hackathon/forms.py index 164ed289..c20c61a3 100644 --- a/hackathon/forms.py +++ b/hackathon/forms.py @@ -232,11 +232,6 @@ class EventForm(forms.ModelForm): label="Description", widget=forms.Textarea(attrs={'rows': 4, 'class': 'form-control'}) ) - isReadOnly = forms.BooleanField( - label="Read Only", - required=False, - widget=forms.CheckboxInput(attrs={'class': 'form-check-input'}) - ) webinar_link = forms.URLField( label="Webinar Link", required=False, @@ -244,13 +239,14 @@ class EventForm(forms.ModelForm): ) webinar_code = forms.CharField( label="Webinar Join Code", + required=False, widget=forms.Textarea(attrs={'rows': 1, 'class': 'form-control'}) ) class Meta: model = Event fields = [ - 'title', 'start', 'end', 'body', - 'isReadOnly', 'webinar_link', + 'title', 'start', 'end', 'body', + 'webinar_link', 'webinar_code', ] diff --git a/hackathon/migrations/0049_event.py b/hackathon/migrations/0049_event.py deleted file mode 100644 index 18dfae8b..00000000 --- a/hackathon/migrations/0049_event.py +++ /dev/null @@ -1,23 +0,0 @@ -# Generated by Django 3.1.13 on 2024-05-10 15:15 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('hackathon', '0048_auto_20221219_1655'), - ] - - operations = [ - migrations.CreateModel( - name='Event', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('title', models.CharField(max_length=200)), - ('start_date', models.DateTimeField()), - ('end_date', models.DateTimeField()), - ('description', models.TextField(blank=True)), - ], - ), - ] diff --git a/hackathon/migrations/0050_auto_20240510_1722.py b/hackathon/migrations/0050_auto_20240510_1722.py deleted file mode 100644 index d39ddc88..00000000 --- a/hackathon/migrations/0050_auto_20240510_1722.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.1.13 on 2024-05-10 17:22 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('hackathon', '0049_event'), - ] - - operations = [ - migrations.AlterField( - model_name='event', - name='description', - field=models.TextField(blank=True, null=True), - ), - ] diff --git a/hackathon/migrations/0051_auto_20240510_1728.py b/hackathon/migrations/0051_auto_20240510_1728.py deleted file mode 100644 index 818db4f2..00000000 --- a/hackathon/migrations/0051_auto_20240510_1728.py +++ /dev/null @@ -1,42 +0,0 @@ -# Generated by Django 3.1.13 on 2024-05-10 17:28 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('hackathon', '0050_auto_20240510_1722'), - ] - - operations = [ - migrations.RenameField( - model_name='event', - old_name='end_date', - new_name='end', - ), - migrations.RenameField( - model_name='event', - old_name='start_date', - new_name='start', - ), - migrations.RemoveField( - model_name='event', - name='description', - ), - migrations.AddField( - model_name='event', - name='calendar_id', - field=models.CharField(default='1', max_length=50), - ), - migrations.AddField( - model_name='event', - name='category', - field=models.CharField(default='time', max_length=50), - ), - migrations.AddField( - model_name='event', - name='due_date_class', - field=models.CharField(blank=True, default='', max_length=50), - ), - ] diff --git a/hackathon/migrations/0052_auto_20240516_1847.py b/hackathon/migrations/0052_auto_20240516_1847.py deleted file mode 100644 index 4e85ae93..00000000 --- a/hackathon/migrations/0052_auto_20240516_1847.py +++ /dev/null @@ -1,23 +0,0 @@ -# Generated by Django 3.1.13 on 2024-05-16 18:47 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('hackathon', '0051_auto_20240510_1728'), - ] - - operations = [ - migrations.AddField( - model_name='event', - name='isReadOnly', - field=models.BooleanField(default=True), - ), - migrations.AlterField( - model_name='event', - name='title', - field=models.CharField(max_length=500), - ), - ] diff --git a/hackathon/migrations/0053_auto_20240516_1850.py b/hackathon/migrations/0053_auto_20240516_1850.py deleted file mode 100644 index 330cdfe9..00000000 --- a/hackathon/migrations/0053_auto_20240516_1850.py +++ /dev/null @@ -1,31 +0,0 @@ -# Generated by Django 3.1.13 on 2024-05-16 18:50 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('hackathon', '0052_auto_20240516_1847'), - ] - - operations = [ - migrations.RemoveField( - model_name='event', - name='category', - ), - migrations.RemoveField( - model_name='event', - name='due_date_class', - ), - migrations.AddField( - model_name='event', - name='body', - field=models.TextField(default='', max_length=500), - ), - migrations.AlterField( - model_name='event', - name='title', - field=models.CharField(max_length=200), - ), - ] diff --git a/hackathon/migrations/0054_event.py b/hackathon/migrations/0054_event.py new file mode 100644 index 00000000..7131bb41 --- /dev/null +++ b/hackathon/migrations/0054_event.py @@ -0,0 +1,28 @@ +# Generated by Django 3.1.13 on 2024-10-04 15:52 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('hackathon', '0053_auto_20240912_1527'), + ] + + operations = [ + migrations.CreateModel( + name='Event', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('title', models.CharField(max_length=200)), + ('start', models.DateTimeField()), + ('end', models.DateTimeField()), + ('body', models.TextField(default='', max_length=500)), + ('isReadOnly', models.BooleanField(default=True)), + ('webinar_link', models.URLField(blank=True, null=True)), + ('webinar_code', models.CharField(blank=True, max_length=50, null=True)), + ('hackathon', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='events', to='hackathon.hackathon')), + ], + ), + ] diff --git a/hackathon/migrations/0054_event_category.py b/hackathon/migrations/0054_event_category.py deleted file mode 100644 index 985d0731..00000000 --- a/hackathon/migrations/0054_event_category.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.1.13 on 2024-05-16 18:53 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('hackathon', '0053_auto_20240516_1850'), - ] - - operations = [ - migrations.AddField( - model_name='event', - name='category', - field=models.CharField(default='task', max_length=50), - ), - ] diff --git a/hackathon/migrations/0055_auto_20240516_2100.py b/hackathon/migrations/0055_auto_20240516_2100.py deleted file mode 100644 index cc489704..00000000 --- a/hackathon/migrations/0055_auto_20240516_2100.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.1.13 on 2024-05-16 21:00 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('hackathon', '0054_event_category'), - ] - - operations = [ - migrations.AlterField( - model_name='event', - name='category', - field=models.CharField(default='time', max_length=50), - ), - ] diff --git a/hackathon/migrations/0056_event_google_calendar_link.py b/hackathon/migrations/0056_event_google_calendar_link.py deleted file mode 100644 index 9fbd7a75..00000000 --- a/hackathon/migrations/0056_event_google_calendar_link.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.1.13 on 2024-05-21 18:07 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('hackathon', '0055_auto_20240516_2100'), - ] - - operations = [ - migrations.AddField( - model_name='event', - name='google_calendar_link', - field=models.URLField(blank=True, null=True), - ), - ] diff --git a/hackathon/migrations/0057_auto_20240910_2006.py b/hackathon/migrations/0057_auto_20240910_2006.py deleted file mode 100644 index 6251330f..00000000 --- a/hackathon/migrations/0057_auto_20240910_2006.py +++ /dev/null @@ -1,23 +0,0 @@ -# Generated by Django 3.1.13 on 2024-09-10 20:06 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('hackathon', '0056_event_google_calendar_link'), - ] - - operations = [ - migrations.AddField( - model_name='event', - name='presentations_intro_link', - field=models.URLField(blank=True, null=True), - ), - migrations.AddField( - model_name='event', - name='zoom_intro_link', - field=models.URLField(blank=True, null=True), - ), - ] diff --git a/hackathon/migrations/0058_auto_20240910_2008.py b/hackathon/migrations/0058_auto_20240910_2008.py deleted file mode 100644 index 5a99c50d..00000000 --- a/hackathon/migrations/0058_auto_20240910_2008.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.1.13 on 2024-09-10 20:08 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('hackathon', '0057_auto_20240910_2006'), - ] - - operations = [ - migrations.RenameField( - model_name='event', - old_name='presentations_intro_link', - new_name='zoom_presentations_link', - ), - ] diff --git a/hackathon/migrations/0059_auto_20240910_2010.py b/hackathon/migrations/0059_auto_20240910_2010.py deleted file mode 100644 index 7b27a4a8..00000000 --- a/hackathon/migrations/0059_auto_20240910_2010.py +++ /dev/null @@ -1,21 +0,0 @@ -# Generated by Django 3.1.13 on 2024-09-10 20:10 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('hackathon', '0058_auto_20240910_2008'), - ] - - operations = [ - migrations.RemoveField( - model_name='event', - name='zoom_intro_link', - ), - migrations.RemoveField( - model_name='event', - name='zoom_presentations_link', - ), - ] diff --git a/hackathon/migrations/0060_event_hackathon.py b/hackathon/migrations/0060_event_hackathon.py deleted file mode 100644 index 2b08d8a0..00000000 --- a/hackathon/migrations/0060_event_hackathon.py +++ /dev/null @@ -1,20 +0,0 @@ -# Generated by Django 3.1.13 on 2024-09-15 14:34 - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('hackathon', '0059_auto_20240910_2010'), - ] - - operations = [ - migrations.AddField( - model_name='event', - name='hackathon', - field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, related_name='events', to='hackathon.hackathon'), - preserve_default=False, - ), - ] diff --git a/hackathon/migrations/0061_remove_event_calendar_id.py b/hackathon/migrations/0061_remove_event_calendar_id.py deleted file mode 100644 index 8172c9d0..00000000 --- a/hackathon/migrations/0061_remove_event_calendar_id.py +++ /dev/null @@ -1,17 +0,0 @@ -# Generated by Django 3.1.13 on 2024-09-15 15:52 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('hackathon', '0060_event_hackathon'), - ] - - operations = [ - migrations.RemoveField( - model_name='event', - name='calendar_id', - ), - ] diff --git a/hackathon/migrations/0062_remove_event_category.py b/hackathon/migrations/0062_remove_event_category.py deleted file mode 100644 index 440b348e..00000000 --- a/hackathon/migrations/0062_remove_event_category.py +++ /dev/null @@ -1,17 +0,0 @@ -# Generated by Django 3.1.13 on 2024-09-15 16:51 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('hackathon', '0061_remove_event_calendar_id'), - ] - - operations = [ - migrations.RemoveField( - model_name='event', - name='category', - ), - ] diff --git a/hackathon/migrations/0063_auto_20240915_1858.py b/hackathon/migrations/0063_auto_20240915_1858.py deleted file mode 100644 index 922ef63f..00000000 --- a/hackathon/migrations/0063_auto_20240915_1858.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.1.13 on 2024-09-15 18:58 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('hackathon', '0062_remove_event_category'), - ] - - operations = [ - migrations.RenameField( - model_name='event', - old_name='google_calendar_link', - new_name='webinar_link', - ), - ] diff --git a/hackathon/migrations/0064_event_webinar_code.py b/hackathon/migrations/0064_event_webinar_code.py deleted file mode 100644 index 59ba0e4c..00000000 --- a/hackathon/migrations/0064_event_webinar_code.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.1.13 on 2024-09-16 10:02 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('hackathon', '0063_auto_20240915_1858'), - ] - - operations = [ - migrations.AddField( - model_name='event', - name='webinar_code', - field=models.CharField(blank=True, max_length=100, null=True), - ), - ] diff --git a/hackathon/migrations/0065_auto_20240916_1009.py b/hackathon/migrations/0065_auto_20240916_1009.py deleted file mode 100644 index 46a955ac..00000000 --- a/hackathon/migrations/0065_auto_20240916_1009.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.1.13 on 2024-09-16 10:09 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('hackathon', '0064_event_webinar_code'), - ] - - operations = [ - migrations.AlterField( - model_name='event', - name='webinar_code', - field=models.CharField(blank=True, max_length=50, null=True), - ), - ] diff --git a/hackathon/templates/hackathon/hackathon_events.html b/hackathon/templates/hackathon/hackathon_events.html index 2177536c..292a7d75 100644 --- a/hackathon/templates/hackathon/hackathon_events.html +++ b/hackathon/templates/hackathon/hackathon_events.html @@ -12,7 +12,7 @@

{{ hackathon.display_name }} - Webinars

{{ hackathon.display_name }} {{ event.title }}

{{ event.start }}

Webinar Link

-

{{ event.body }}

+

{{ event.body | safe }}

Edit diff --git a/hackathon/urls.py b/hackathon/urls.py index 9b16124f..6b411629 100644 --- a/hackathon/urls.py +++ b/hackathon/urls.py @@ -14,7 +14,6 @@ judge_teams, assign_mentors, view_hackathon_public, - event_list, hackathon_events, delete_event, hackathon_events_endpoint, @@ -47,7 +46,6 @@ name="judge_teams"), path('/assign_mentors/', assign_mentors, name="assign_mentors"), - path('events/', event_list, name='event-list'), path('hackathon//event/', change_event, name='change_event'), path('hackathon//event//', change_event, diff --git a/hackathon/views.py b/hackathon/views.py index 10099d7f..ec3b7326 100644 --- a/hackathon/views.py +++ b/hackathon/views.py @@ -593,24 +593,6 @@ def assign_mentors(request, hackathon_id): f"{hack_mentors_formset.errors}")) -def event_list(request, hackathon_id): - """ - Get a list of events for the calendar from the events db for a specific hackathon - """ - hackathon = get_object_or_404(Hackathon, pk=hackathon_id) - event_list_data = Event.objects.filter(hackathon=hackathon) - event_list = [{ - 'id': str(event.id), - 'calendarId': event.calendar_id, - 'title': event.title, - 'body': event.body, - 'start': event.start.strftime('%Y-%m-%dT%H:%M:%S'), - 'end': event.end.strftime('%Y-%m-%dT%H:%M:%S'), - 'webinar_link': event.webinar_link, - } for event in event_list_data] - return JsonResponse(event_list, safe=False, encoder=DjangoJSONEncoder) - - @login_required @can_access([UserType.SUPERUSER, UserType.FACILITATOR_ADMIN, UserType.PARTNER_ADMIN], redirect_url='hackathon:hackathon-list') def hackathon_events(request, hackathon_id):