Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WC Admin application cycle edit/create table #590

Merged
merged 15 commits into from
Jan 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
# Python files
__pycache__/
*.pyc
.python-version

# Distribution
/frontend/public/storybook/
Expand All @@ -27,6 +28,8 @@ db.sqlite3

# React
node_modules/
.yarn
.yarnrc.yml
.next/

# Development Enviroment
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 3.2.18 on 2023-11-17 22:01

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("clubs", "0090_auto_20230106_1443"),
]

operations = [
migrations.AddField(
model_name="clubapplication",
name="application_end_time_exception",
field=models.BooleanField(blank=True, default=False),
),
]
13 changes: 13 additions & 0 deletions backend/clubs/migrations/0092_merge_20240106_1117.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Generated by Django 3.2.18 on 2024-01-06 16:17

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
("clubs", "0091_applicationextension"),
("clubs", "0091_clubapplication_application_end_time_exception"),
]

operations = []
1 change: 1 addition & 0 deletions backend/clubs/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1551,6 +1551,7 @@ class ClubApplication(CloneModel):
description = models.TextField(blank=True)
application_start_time = models.DateTimeField()
application_end_time = models.DateTimeField()
application_end_time_exception = models.BooleanField(default=False, blank=True)
name = models.TextField(blank=True)
result_release_time = models.DateTimeField()
application_cycle = models.ForeignKey(
Expand Down
20 changes: 20 additions & 0 deletions backend/clubs/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
AdminNote,
Advisor,
ApplicationCommittee,
ApplicationCycle,
ApplicationExtension,
ApplicationMultipleChoice,
ApplicationQuestion,
Expand Down Expand Up @@ -97,6 +98,24 @@ def save(self):
return super().save()


class ApplicationCycleSerializer(serializers.ModelSerializer):
class Meta:
model = ApplicationCycle
fields = ["id", "name", "start_date", "end_date"]
rohangpta marked this conversation as resolved.
Show resolved Hide resolved

def validate(self, data):
"""
Check that start_date is before end_date.
"""
start_date = data.get("start_date")
end_date = data.get("end_date")

if start_date and end_date and start_date >= end_date:
raise serializers.ValidationError("Start must be before end.")

return data


class TagSerializer(serializers.ModelSerializer):
clubs = serializers.IntegerField(read_only=True)

Expand Down Expand Up @@ -2800,6 +2819,7 @@ class Meta:
"rejection_email",
"application_start_time",
"application_end_time",
"application_end_time_exception",
"result_release_time",
"external_url",
"committees",
Expand Down
12 changes: 7 additions & 5 deletions backend/clubs/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
UserZoomAPIView,
WhartonApplicationAPIView,
WhartonApplicationStatusAPIView,
WhartonCyclesView,
YearViewSet,
email_preview,
)
Expand Down Expand Up @@ -78,6 +79,12 @@
router.register(
r"external/members/(?P<code>.+)", ExternalMemberListViewSet, basename="external"
)
router.register(
r"cycles", WhartonCyclesView, basename="wharton-applications-create",
)
router.register(
r"whartonapplications", WhartonApplicationAPIView, basename="wharton",
)
router.register(r"submissions", ApplicationSubmissionUserViewSet, basename="submission")

clubs_router = routers.NestedSimpleRouter(router, r"clubs", lookup="club")
Expand Down Expand Up @@ -156,11 +163,6 @@
MeetingZoomWebhookAPIView.as_view(),
name="webhooks-meeting",
),
path(
r"whartonapplications/",
WhartonApplicationAPIView.as_view(),
name="wharton-applications",
),
path(
r"whartonapplications/status/",
WhartonApplicationStatusAPIView.as_view(),
Expand Down
Loading
Loading