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

Update SpaceAPI to return integer version number #243

Merged
merged 2 commits into from
Feb 2, 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
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
2 changes: 1 addition & 1 deletion memberportal/api_spacedirectory/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def get(self, request):
"open": config.SPACE_DIRECTORY_ICON_OPEN,
"closed": config.SPACE_DIRECTORY_ICON_CLOSED,
}
spaceapi["api_compatibility"] = ["0.14"]
spaceapi["api_compatibility"] = ["14"]

## Add the sensor data to the main body of the schema
spaceapi["sensors"] = sensor_data
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
Loading