Skip to content

Commit

Permalink
Merge master into ticketing (#687)
Browse files Browse the repository at this point in the history
* fix expires_at test test (#664)

* Cast exception to str in management command

* Move submissions from /apply to user profile (#638)

* finished changes

* Remove Wharton applications from user profile (and update branch) (#641)

* Update main.ts

* Update frontend dependencies (#616)

Upgrade from Node 14 to Node 20 and bump frontend dependency versions to current.

---------

Co-authored-by: Julian Weng <[email protected]>

* Update README.md

* Update README backend instructions and intro blurb

* Fix admin page access on frontend. (#626)

Add frontend check for existing pre-loaded permissions on /admin.

* Removed deprecated QuestionResponse model and duplicate line (#625)

* Remove deprecated QuestionResponse model

* remove duplicate line: 'rank field in Club'

* made migrations after deleting QuestionResponse

* Streamline django storages config (#618)

* Add staticfiles

* Fix AWS bucket routing for boto

* Try setting credentials through env vars

* Try renaming env vars?

* Set AWS region

* add back staticfiles

* Remove region and signature version

* Move credentials to new API

* Use env variables and remove staticfiles

* Add back staticfiles

* Make code look pretty

---------

Co-authored-by: Rohan Moniz <[email protected]>

* Add hour to displayed application deadline (#628)

* Add hour for application due dates

* Make linter happy

* Specify Eastern time zone

* Display username if name is empty (#637)

* finished changes

* Remove Wharton applications from user profile

* Fix weird artifacts from merge

---------

Co-authored-by: Joy Liu <[email protected]>
Co-authored-by: Julian Weng <[email protected]>
Co-authored-by: Rohan Moniz <[email protected]>
Co-authored-by: Thomas Ngulube <[email protected]>
Co-authored-by: Owen Lester <[email protected]>

* Bump debounce timeout to 400ms (#640)

* Bump debounce timeout to 400ms

* Make linter happy

* small changes

* added type

* merging

* deleted file

---------

Co-authored-by: Avi Upadhyayula <[email protected]>
Co-authored-by: Joy Liu <[email protected]>
Co-authored-by: Julian Weng <[email protected]>
Co-authored-by: Rohan Moniz <[email protected]>
Co-authored-by: Thomas Ngulube <[email protected]>

* Add carousel (#622)

* add carousel

* Old react-multi-carousel

* fixed npm yarn

* remvoed packagelock.json

* fixing issues

* change height

* minor changes

* deleted a comment

* merging?

* delete one onClick

* change breakpoint

* Revert "Move submissions from /apply to user profile (#638)" (#673)

This reverts commit 29d9a12.

* Revert "Add carousel (#622)" (#674)

This reverts commit fcab615.

* Improve error reporting in mgmt cmds (#678)

* Fix bug in Excel column names (#683)

* Remove unused `tickets_count` field

---------

Co-authored-by: Thomas Ngulube <[email protected]>
Co-authored-by: owlester12 <[email protected]>
Co-authored-by: Joy Liu <[email protected]>
Co-authored-by: Julian Weng <[email protected]>
Co-authored-by: Rohan Moniz <[email protected]>
  • Loading branch information
6 people authored Apr 29, 2024
1 parent ff74f68 commit e1fac0b
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import traceback

from django.core.management.base import BaseCommand
from django.utils import timezone

Expand All @@ -17,10 +19,10 @@ def handle(self, *args, **kwargs):
self.stdout.write(
self.style.SUCCESS("Successfully marked all stale invites as expired!")
)
except Exception as e:
except Exception:

Check warning on line 22 in backend/clubs/management/commands/expire_membership_invites.py

View check run for this annotation

Codecov / codecov/patch

backend/clubs/management/commands/expire_membership_invites.py#L22

Added line #L22 was not covered by tests
self.stdout.write(
self.style.ERROR(
"An error was encountered while expiring stale membership invites!"
)
)
self.stdout.write(e)
self.stdout.write(self.style.ERROR(traceback.format_exc()))

Check warning on line 28 in backend/clubs/management/commands/expire_membership_invites.py

View check run for this annotation

Codecov / codecov/patch

backend/clubs/management/commands/expire_membership_invites.py#L28

Added line #L28 was not covered by tests
2 changes: 2 additions & 0 deletions backend/clubs/management/commands/find_broken_images.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
import traceback

import requests
from django.conf import settings
Expand Down Expand Up @@ -41,6 +42,7 @@ def handle(self, *args, **kwargs):
"{} has broken image {}".format(club.code, club.image.url)
)
)
self.stdout.write(self.style.ERROR(traceback.format_exc()))

Check warning on line 45 in backend/clubs/management/commands/find_broken_images.py

View check run for this annotation

Codecov / codecov/patch

backend/clubs/management/commands/find_broken_images.py#L45

Added line #L45 was not covered by tests
if not self.dry_run:
club.image.delete(save=True)
broken_list.append(
Expand Down
9 changes: 5 additions & 4 deletions backend/clubs/management/commands/update_club_counts.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import traceback

from django.core.management.base import BaseCommand
from django.db.models import Count, Q

Expand Down Expand Up @@ -26,11 +28,10 @@ def handle(self, *args, **kwargs):
"Successfully updated all club favorite and membership counts!"
)
)
except Exception as e:
except Exception:

Check warning on line 31 in backend/clubs/management/commands/update_club_counts.py

View check run for this annotation

Codecov / codecov/patch

backend/clubs/management/commands/update_club_counts.py#L31

Added line #L31 was not covered by tests
self.stdout.write(
self.style.ERROR(
"An error was encountered while updating"
+ "club favorite and membership counts!"
"Error while updating club favorite & membership counts!"
)
)
self.stdout.write(e)
self.stdout.write(self.style.ERROR(traceback.format_exc()))

Check warning on line 37 in backend/clubs/management/commands/update_club_counts.py

View check run for this annotation

Codecov / codecov/patch

backend/clubs/management/commands/update_club_counts.py#L37

Added line #L37 was not covered by tests
4 changes: 0 additions & 4 deletions backend/clubs/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -956,10 +956,6 @@ def create_thumbnail(self, request=None):
def __str__(self):
return self.name

@property
def tickets_count(self):
return Ticket.objects.count(event=self)


class Favorite(models.Model):
"""
Expand Down
2 changes: 2 additions & 0 deletions backend/clubs/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2338,6 +2338,8 @@ def get_xlsx_column_name(key):
label = json.loads(fair.questions)[index]["label"]
return f"[{fair.name}] {label}"
return f"Registered for {fair.name}"
else:
return key

Check warning on line 2342 in backend/clubs/serializers.py

View check run for this annotation

Codecov / codecov/patch

backend/clubs/serializers.py#L2342

Added line #L2342 was not covered by tests

class Meta(AuthenticatedClubSerializer.Meta):
pass
Expand Down
10 changes: 4 additions & 6 deletions backend/tests/clubs/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1688,14 +1688,12 @@ def test_send_invite_with_acceptance_email(self):
expiry_date = now + timezone.timedelta(days=5)

# Compare the expiry dates excluding microseconds
self.assertEqual(
invite1.expires_at.replace(microsecond=0),
expiry_date.replace(microsecond=0),
self.assertLessEqual(
abs(invite1.expires_at - expiry_date), timezone.timedelta(minutes=5)
)

self.assertEqual(
invite2.expires_at.replace(microsecond=0),
expiry_date.replace(microsecond=0),
self.assertLessEqual(
abs(invite2.expires_at - expiry_date), timezone.timedelta(minutes=5)
)

# Check that applicants not accepted are not invited
Expand Down

0 comments on commit e1fac0b

Please sign in to comment.