Skip to content

Commit

Permalink
Merge pull request #909 from Nandika-A/main
Browse files Browse the repository at this point in the history
Resolved issue #859. Fixed attribute error.
  • Loading branch information
amakarudze authored Oct 2, 2023
2 parents 2b2fc15 + 2627f65 commit 6090c9f
Show file tree
Hide file tree
Showing 48 changed files with 17 additions and 53 deletions.
1 change: 0 additions & 1 deletion applications/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@


class Migration(migrations.Migration):

initial = True

dependencies = []
Expand Down
1 change: 0 additions & 1 deletion applications/migrations/0002_auto_20171216_2124.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@


class Migration(migrations.Migration):

initial = True

dependencies = [
Expand Down
1 change: 0 additions & 1 deletion applications/migrations/0003_auto_20180529_0016.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@


class Migration(migrations.Migration):

dependencies = [
("applications", "0002_auto_20171216_2124"),
]
Expand Down
1 change: 0 additions & 1 deletion applications/migrations/0004_add_on_delete.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@


class Migration(migrations.Migration):

dependencies = [
("applications", "0003_auto_20180529_0016"),
]
Expand Down
1 change: 0 additions & 1 deletion applications/migrations/0005_auto_20210906_0915.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@


class Migration(migrations.Migration):

dependencies = [
("applications", "0004_add_on_delete"),
]
Expand Down
1 change: 0 additions & 1 deletion applications/migrations/0006_auto_20221231_1925.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@


class Migration(migrations.Migration):

dependencies = [
("applications", "0005_auto_20210906_0915"),
]
Expand Down
15 changes: 14 additions & 1 deletion applications/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@
from core.models import User


def get_default(order):
"""
Gets the selected order and checks whether it contains more than one way of ordering.
If it does, this returns the first order selected.
This is to ensure that only one way of ordering is selected.
"""
ind = order.find(",")
order = order[:ind]
return order


def get_applications_for_event(event, state=None, rsvp_status=None, order=None, user: User = None):
"""
Return a QuerySet of Application objects for a given event.
Expand Down Expand Up @@ -37,7 +48,9 @@ def get_applications_for_event(event, state=None, rsvp_status=None, order=None,
reverse=is_reversed,
)
else:
applications = sorted(applications, key=lambda app: getattr(app, order), reverse=is_reversed)
applications = sorted(
applications, key=lambda app: getattr(app, order, get_default(order)), reverse=is_reversed
)

return applications

Expand Down
1 change: 0 additions & 1 deletion coach/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@


class Migration(migrations.Migration):

initial = True

dependencies = []
Expand Down
1 change: 0 additions & 1 deletion coach/migrations/0002_alter_coach_id.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@


class Migration(migrations.Migration):

dependencies = [
("coach", "0001_initial"),
]
Expand Down
1 change: 0 additions & 1 deletion contact/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@


class Migration(migrations.Migration):

initial = True

dependencies = []
Expand Down
1 change: 0 additions & 1 deletion contact/migrations/0002_contactemail_event.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@


class Migration(migrations.Migration):

initial = True

dependencies = [
Expand Down
1 change: 0 additions & 1 deletion contact/migrations/0003_auto_20171217_1144.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@


class Migration(migrations.Migration):

dependencies = [
("contact", "0002_contactemail_event"),
]
Expand Down
1 change: 0 additions & 1 deletion contact/migrations/0004_alter_contactemail_id.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@


class Migration(migrations.Migration):

dependencies = [
("contact", "0003_auto_20171217_1144"),
]
Expand Down
1 change: 0 additions & 1 deletion core/management/commands/update_coordinates.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ class Command(BaseCommand):
help = "Update coordinates of event cities"

def handle(self, *args, **options):

events = Event.objects.all()

for event in events:
Expand Down
1 change: 0 additions & 1 deletion core/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@


class Migration(migrations.Migration):

initial = True

dependencies = [
Expand Down
1 change: 0 additions & 1 deletion core/migrations/0002_auto_20171217_1144.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@


class Migration(migrations.Migration):

dependencies = [
("core", "0001_initial"),
]
Expand Down
1 change: 0 additions & 1 deletion core/migrations/0003_auto_20210906_0915.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@


class Migration(migrations.Migration):

dependencies = [
("core", "0002_auto_20171217_1144"),
]
Expand Down
1 change: 0 additions & 1 deletion core/migrations/0004_auto_20220422_1316.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@


class Migration(migrations.Migration):

dependencies = [
("core", "0003_auto_20210906_0915"),
]
Expand Down
1 change: 0 additions & 1 deletion core/migrations/0005_auto_20220422_1321.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@


class Migration(migrations.Migration):

dependencies = [
("core", "0004_auto_20220422_1316"),
]
Expand Down
1 change: 0 additions & 1 deletion globalpartners/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@


class Migration(migrations.Migration):

initial = True

dependencies = []
Expand Down
1 change: 0 additions & 1 deletion jobboard/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@


class Migration(migrations.Migration):

initial = True

dependencies = []
Expand Down
1 change: 0 additions & 1 deletion jobboard/migrations/0002_auto_20230202_1131.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@


class Migration(migrations.Migration):

dependencies = [
("globalpartners", "0001_initial"),
("jobboard", "0001_initial"),
Expand Down
1 change: 0 additions & 1 deletion organize/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@


class Migration(migrations.Migration):

initial = True

dependencies = [
Expand Down
1 change: 0 additions & 1 deletion organize/migrations/0002_auto_20171217_1144.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@


class Migration(migrations.Migration):

dependencies = [
("organize", "0001_initial"),
]
Expand Down
1 change: 0 additions & 1 deletion organize/migrations/0003_auto_20190727_2013.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@


class Migration(migrations.Migration):

dependencies = [
("organize", "0002_auto_20171217_1144"),
]
Expand Down
1 change: 0 additions & 1 deletion organize/migrations/0004_auto_20201028_1923.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@


class Migration(migrations.Migration):

dependencies = [
("organize", "0003_auto_20190727_2013"),
]
Expand Down
1 change: 0 additions & 1 deletion organize/migrations/0005_eventapplication_additional.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@


class Migration(migrations.Migration):

dependencies = [
("organize", "0004_auto_20201028_1923"),
]
Expand Down
1 change: 0 additions & 1 deletion organize/migrations/0006_eventapplication_diversity.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@


class Migration(migrations.Migration):

dependencies = [
("organize", "0005_eventapplication_additional"),
]
Expand Down
1 change: 0 additions & 1 deletion organize/migrations/0007_auto_20210906_1216.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@


class Migration(migrations.Migration):

dependencies = [
("organize", "0006_eventapplication_diversity"),
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@


class Migration(migrations.Migration):

dependencies = [
("organize", "0007_auto_20210906_1216"),
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@


class Migration(migrations.Migration):

dependencies = [
("organize", "0008_eventapplication_local_restrictions"),
]
Expand Down
1 change: 0 additions & 1 deletion patreonmanager/management/commands/fundraising_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from slack_sdk.errors import SlackApiError

from core.slack_client import post_message_to_slack

from patreonmanager.models import FundraisingStatus

DJANGOGIRLS_USER_ID = 483065
Expand Down
1 change: 0 additions & 1 deletion patreonmanager/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@


class Migration(migrations.Migration):

initial = True

dependencies = []
Expand Down
1 change: 0 additions & 1 deletion patreonmanager/migrations/0002_auto_20171217_1144.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@


class Migration(migrations.Migration):

dependencies = [
("patreonmanager", "0001_initial"),
]
Expand Down
1 change: 0 additions & 1 deletion patreonmanager/migrations/0003_auto_20210906_0915.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@


class Migration(migrations.Migration):

dependencies = [
("patreonmanager", "0002_auto_20171217_1144"),
]
Expand Down
1 change: 0 additions & 1 deletion pictures/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@


class Migration(migrations.Migration):

initial = True

dependencies = []
Expand Down
1 change: 0 additions & 1 deletion pictures/migrations/0002_alter_stockpicture_id.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@


class Migration(migrations.Migration):

dependencies = [
("pictures", "0001_initial"),
]
Expand Down
1 change: 0 additions & 1 deletion sponsor/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@


class Migration(migrations.Migration):

initial = True

dependencies = []
Expand Down
1 change: 0 additions & 1 deletion sponsor/migrations/0002_donor.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@


class Migration(migrations.Migration):

dependencies = [
("sponsor", "0001_initial"),
]
Expand Down
1 change: 0 additions & 1 deletion sponsor/migrations/0003_auto_20210906_0915.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@


class Migration(migrations.Migration):

dependencies = [
("sponsor", "0002_donor"),
]
Expand Down
1 change: 0 additions & 1 deletion story/management/commands/fetch_stories.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ class Command(BaseCommand):
help = "Fetch Django Girls stories from our blog"

def handle(self, *args, **options):

rss_url = "http://blog.djangogirls.org/rss"

response = requests.get(rss_url)
Expand Down
1 change: 0 additions & 1 deletion story/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@


class Migration(migrations.Migration):

initial = True

dependencies = []
Expand Down
1 change: 0 additions & 1 deletion story/migrations/0002_alter_story_id.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@


class Migration(migrations.Migration):

dependencies = [
("story", "0001_initial"),
]
Expand Down
1 change: 0 additions & 1 deletion tests/applications/views/test_apply.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ def test_event_not_live(client, hidden_event):


def test_application_form_valid(client, future_event_form, future_event):

question_data = {
"question_1": "Bill Smith",
"question_2": "bill.smith@djangogirls.org",
Expand Down
Loading

0 comments on commit 6090c9f

Please sign in to comment.