Skip to content

Commit

Permalink
fix: renamed greviance to grievance
Browse files Browse the repository at this point in the history
  • Loading branch information
Dhruv9449 committed Apr 28, 2024
1 parent cea1681 commit d5186bf
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class OrganizationViewSet(ReadOnlyModelViewSet):
search_fields = ["name"]
ordering_fields = ["name"]
ordering = ["name"]
special_organization_types = ["student_welfare", "student_council", "greviance_cell", "counselling_division"]
special_organization_types = ["student_welfare", "student_council", "grievance_cell", "counselling_division"]

def get_serializer_class(self):
if (self.action == "list") and (
Expand All @@ -71,7 +71,7 @@ def get(request):
status=status.HTTP_400_BAD_REQUEST,
)

if organization_type not in ["student_welfare", "student_council", "greviance_cell"]:
if organization_type not in ["student_welfare", "student_council", "grievance_cell"]:
return Response(
{"detail": "Invalid type parameter"},
status=status.HTTP_400_BAD_REQUEST,
Expand Down Expand Up @@ -102,7 +102,7 @@ def get(request):
status=status.HTTP_400_BAD_REQUEST,
)

if organization_type in ["student_welfare", "student_council", "greviance_cell", "counselling_division"]:
if organization_type in ["student_welfare", "student_council", "grievance_cell", "counselling_division"]:
return Response(
{"detail": "Special organizations type parameter not allowed"},
status=status.HTTP_400_BAD_REQUEST,
Expand Down Expand Up @@ -131,7 +131,7 @@ class OrganizationAdminViewSet(ModelViewSet):
search_fields = ["name"]
ordering_fields = ["name"]
ordering = ["name"]
special_organization_types = ["student_welfare", "student_council", "greviance_cell"]
special_organization_types = ["student_welfare", "student_council", "grievance_cell"]

def get_serializer_class(self):
if (self.action == "list") and (
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 4.0.10 on 2024-04-28 06:54

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('core', '0020_alter_organization_type'),
]

operations = [
migrations.AlterField(
model_name='organization',
name='type',
field=models.CharField(choices=[('student_welfare', 'Student Welfare'), ('student_council', 'Student Council'), ('club', 'Club'), ('chapter', 'Chapter'), ('team', 'Team'), ('grievance_cell', 'Grievance Cell'), ('counselling_division', 'Counselling Division'), ('other', 'Other')], default='club', max_length=50, verbose_name='Type'),
),
]
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class Organization(models.Model):
("club", "Club"),
("chapter", "Chapter"),
("team", "Team"),
("greviance_cell", "Greviance Cell"),
("grievance_cell", "Grievance Cell"),
("counselling_division", "Counselling Division"),
("other", "Other"),
]
Expand Down

0 comments on commit d5186bf

Please sign in to comment.