Skip to content

Commit

Permalink
Update pre-commit hook and re-format
Browse files Browse the repository at this point in the history
  • Loading branch information
rechner committed Feb 1, 2024
1 parent ee4e1a6 commit e194f27
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/psf/black
rev: 21.8b0
rev: 24.1.1
hooks:
- id: black
language_version: python3
8 changes: 5 additions & 3 deletions memberportal/api_admin_tools/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -726,9 +726,11 @@ def get(self, request, member_id):
"totalTime": interlock_log.total_time,
"totalCost": (interlock_log.total_cost or 0) / 100,
"status": status,
"userEnded": interlock_log.user_ended.get_full_name()
if interlock_log.user_ended
else None,
"userEnded": (
interlock_log.user_ended.get_full_name()
if interlock_log.user_ended
else None
),
}
)

Expand Down
16 changes: 8 additions & 8 deletions memberportal/api_general/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,14 +394,14 @@ def get(self, request):
"expiry": p.stripe_card_expiry,
},
},
"membershipPlan": p.membership_plan.get_object()
if p.membership_plan
else None,
"membershipTier": p.membership_plan.member_tier.get_object()
if p.membership_plan
else None
if p.membership_plan
else None,
"membershipPlan": (
p.membership_plan.get_object() if p.membership_plan else None
),
"membershipTier": (
p.membership_plan.member_tier.get_object()
if p.membership_plan
else None if p.membership_plan else None
),
"subscriptionState": p.subscription_status,
},
"permissions": {"admin": user.is_admin},
Expand Down
1 change: 1 addition & 0 deletions memberportal/membermatters/urls.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""membermatters URL Configuration
"""

import os
import django.db.utils
from django.contrib import admin
Expand Down
1 change: 1 addition & 0 deletions memberportal/membermatters/wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
For more information on this file, see
https://docs.djangoproject.com/en/1.9/howto/deployment/wsgi/
"""

import os
from django.core.wsgi import get_wsgi_application
import logging, sys
Expand Down
26 changes: 15 additions & 11 deletions memberportal/profile/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -538,19 +538,23 @@ def get_basic_profile(self):
"rfid": self.rfid,
"memberBucks": {
"balance": self.memberbucks_balance,
"lastPurchase": self.last_memberbucks_purchase.strftime(
"%m/%d/%Y, %H:%M:%S"
)
if self.last_memberbucks_purchase
else None,
"lastPurchase": (
self.last_memberbucks_purchase.strftime("%m/%d/%Y, %H:%M:%S")
if self.last_memberbucks_purchase
else None
),
},
"updateProfileRequired": self.must_update_profile,
"lastSeen": self.last_seen.strftime("%m/%d/%Y, %H:%M:%S")
if self.last_seen
else None,
"lastInduction": self.last_induction.strftime("%m/%d/%Y, %H:%M:%S")
if self.last_induction
else None,
"lastSeen": (
self.last_seen.strftime("%m/%d/%Y, %H:%M:%S")
if self.last_seen
else None
),
"lastInduction": (
self.last_induction.strftime("%m/%d/%Y, %H:%M:%S")
if self.last_induction
else None
),
"stripe": {
"cardExpiry": self.stripe_card_expiry,
"last4": self.stripe_card_last_digits,
Expand Down

0 comments on commit e194f27

Please sign in to comment.