mirror of
https://gitlab.crans.org/bde/nk20
synced 2025-12-10 05:37:46 +01:00
Compare commits
2 Commits
main
...
promotion-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a25afea16d | ||
|
|
56167a21b5 |
@@ -28,6 +28,3 @@ OIDC_RSA_PRIVATE_KEY=CHANGE_ME
|
|||||||
# Activity configuration
|
# Activity configuration
|
||||||
TRUSTED_ACTIVITY_MAIL=
|
TRUSTED_ACTIVITY_MAIL=
|
||||||
ACTIVITY_EMAIL_MANAGER=
|
ACTIVITY_EMAIL_MANAGER=
|
||||||
|
|
||||||
# App Store App ID
|
|
||||||
APP_STORE_APP_ID=P5246D3AFQ.org.crans.bde.note
|
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ from phonenumber_field.modelfields import PhoneNumberField
|
|||||||
from permission.models import Role
|
from permission.models import Role
|
||||||
from registration.tokens import email_validation_token
|
from registration.tokens import email_validation_token
|
||||||
from note.models import MembershipTransaction
|
from note.models import MembershipTransaction
|
||||||
|
from django.core.validators import MaxValueValidator, MinValueValidator
|
||||||
|
|
||||||
|
|
||||||
class Profile(models.Model):
|
class Profile(models.Model):
|
||||||
@@ -76,6 +77,10 @@ class Profile(models.Model):
|
|||||||
default=datetime.date.today().year if datetime.date.today().month >= 8 else datetime.date.today().year - 1,
|
default=datetime.date.today().year if datetime.date.today().month >= 8 else datetime.date.today().year - 1,
|
||||||
verbose_name=_("promotion"),
|
verbose_name=_("promotion"),
|
||||||
help_text=_("Year of entry to the school (None if not ENS student)"),
|
help_text=_("Year of entry to the school (None if not ENS student)"),
|
||||||
|
validators=[
|
||||||
|
MinValueValidator(1912),
|
||||||
|
MaxValueValidator(datetime.date.today().year if datetime.date.today().month >= 8 else datetime.date.today().year - 1)
|
||||||
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
address = models.CharField(
|
address = models.CharField(
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ from django.views.defaults import bad_request, permission_denied, page_not_found
|
|||||||
from member.views import CustomLoginView
|
from member.views import CustomLoginView
|
||||||
|
|
||||||
from .admin import admin_site
|
from .admin import admin_site
|
||||||
from .views import IndexView, apple_app_site_association
|
from .views import IndexView
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
# Dev so redirect to something random
|
# Dev so redirect to something random
|
||||||
@@ -33,9 +33,6 @@ urlpatterns = [
|
|||||||
path('accounts/', include('django.contrib.auth.urls')),
|
path('accounts/', include('django.contrib.auth.urls')),
|
||||||
path('api/', include('api.urls')),
|
path('api/', include('api.urls')),
|
||||||
path('permission/', include('permission.urls')),
|
path('permission/', include('permission.urls')),
|
||||||
|
|
||||||
# Apple App Site Association
|
|
||||||
path('.well-known/apple-app-site-association', apple_app_site_association),
|
|
||||||
]
|
]
|
||||||
|
|
||||||
# During development, serve static and media files
|
# During development, serve static and media files
|
||||||
|
|||||||
@@ -6,8 +6,6 @@ from django.urls import reverse
|
|||||||
from django.views.generic import RedirectView
|
from django.views.generic import RedirectView
|
||||||
from note.models import Alias
|
from note.models import Alias
|
||||||
from permission.backends import PermissionBackend
|
from permission.backends import PermissionBackend
|
||||||
from django.http import JsonResponse
|
|
||||||
import os
|
|
||||||
|
|
||||||
|
|
||||||
class IndexView(LoginRequiredMixin, RedirectView):
|
class IndexView(LoginRequiredMixin, RedirectView):
|
||||||
@@ -30,13 +28,3 @@ class IndexView(LoginRequiredMixin, RedirectView):
|
|||||||
|
|
||||||
# Non-Kfet members will don't see the transfer page, but their profile page
|
# Non-Kfet members will don't see the transfer page, but their profile page
|
||||||
return reverse("member:user_detail", args=(user.pk,))
|
return reverse("member:user_detail", args=(user.pk,))
|
||||||
|
|
||||||
def apple_app_site_association(request):
|
|
||||||
data = {
|
|
||||||
"webcredentials": {
|
|
||||||
"apps": [
|
|
||||||
os.getenv("APP_STORE_APP_ID")
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return JsonResponse(data)
|
|
||||||
|
|||||||
Reference in New Issue
Block a user