-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into cas-out-of-ustc
- Loading branch information
Showing
25 changed files
with
523 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
from datetime import timedelta | ||
|
||
from django.urls import path | ||
|
||
from .base import DomainEmailValidator | ||
from .external import ExternalLoginView, ExternalGetCodeView | ||
|
||
|
||
class LoginView(ExternalLoginView): | ||
template_context = {'provider_name': '广东海洋大学'} | ||
provider = 'gdou' | ||
group = 'gdou' | ||
|
||
|
||
class GetCodeView(ExternalGetCodeView): | ||
provider = 'gdou' | ||
duration = timedelta(hours=1) | ||
validate_identity = DomainEmailValidator(['stu.gdou.edu.cn']) | ||
|
||
|
||
urlpatterns = [ | ||
path('gdou/login/', LoginView.as_view()), | ||
path('gdou/get_code/', GetCodeView.as_view()), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
from datetime import timedelta | ||
|
||
from django.urls import path | ||
|
||
from .base import DomainEmailValidator | ||
from .external import ExternalLoginView, ExternalGetCodeView | ||
|
||
|
||
class LoginView(ExternalLoginView): | ||
template_context = {'provider_name': '广东工业大学'} | ||
provider = 'gdut' | ||
group = 'gdut' | ||
|
||
|
||
class GetCodeView(ExternalGetCodeView): | ||
provider = 'gdut' | ||
duration = timedelta(hours=1) | ||
validate_identity = DomainEmailValidator(['mail2.gdut.edu.cn']) | ||
|
||
|
||
urlpatterns = [ | ||
path('gdut/login/', LoginView.as_view()), | ||
path('gdut/get_code/', GetCodeView.as_view()), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
from datetime import timedelta | ||
|
||
from django.urls import path | ||
|
||
from .base import DomainEmailValidator | ||
from .external import ExternalLoginView, ExternalGetCodeView | ||
|
||
|
||
class LoginView(ExternalLoginView): | ||
template_context = {'provider_name': '广州大学'} | ||
provider = 'gzhu' | ||
group = 'gzhu' | ||
|
||
|
||
class GetCodeView(ExternalGetCodeView): | ||
provider = 'gzhu' | ||
duration = timedelta(hours=1) | ||
validate_identity = DomainEmailValidator(['e.gzhu.edu.cn']) | ||
|
||
|
||
urlpatterns = [ | ||
path('gzhu/login/', LoginView.as_view()), | ||
path('gzhu/get_code/', GetCodeView.as_view()), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
from datetime import timedelta | ||
|
||
from django.urls import path | ||
|
||
from .base import UserRegexAndDomainEmailValidator | ||
from .external import ExternalLoginView, ExternalGetCodeView | ||
|
||
|
||
class LoginView(ExternalLoginView): | ||
template_context = {'provider_name': '上海大学'} | ||
provider = 'shu' | ||
group = 'shu' | ||
|
||
|
||
class GetCodeView(ExternalGetCodeView): | ||
provider = 'shu' | ||
duration = timedelta(hours=1) | ||
validate_identity = UserRegexAndDomainEmailValidator('shu.edu.cn', r'^(?:[a-z]|_|-|\d){3,50}$') | ||
|
||
|
||
urlpatterns = [ | ||
path('shu/login/', LoginView.as_view()), | ||
path('shu/get_code/', GetCodeView.as_view()), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
from datetime import timedelta | ||
|
||
from django.urls import path | ||
|
||
from .base import DomainEmailValidator | ||
from .external import ExternalLoginView, ExternalGetCodeView | ||
|
||
|
||
class LoginView(ExternalLoginView): | ||
template_context = {'provider_name': '南方科技大学'} | ||
provider = 'sustech' | ||
group = 'sustech' | ||
|
||
|
||
class GetCodeView(ExternalGetCodeView): | ||
provider = 'sustech' | ||
duration = timedelta(hours=1) | ||
validate_identity = DomainEmailValidator(['sustech.edu.cn', 'mail.sustech.edu.cn']) | ||
|
||
|
||
urlpatterns = [ | ||
path('sustech/login/', LoginView.as_view()), | ||
path('sustech/get_code/', GetCodeView.as_view()), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
from datetime import timedelta | ||
|
||
from django.urls import path | ||
|
||
from .base import DomainEmailValidator | ||
from .external import ExternalLoginView, ExternalGetCodeView | ||
|
||
|
||
class LoginView(ExternalLoginView): | ||
template_context = {'provider_name': '厦门理工学院'} | ||
provider = 'xmut' | ||
group = 'xmut' | ||
|
||
|
||
class GetCodeView(ExternalGetCodeView): | ||
provider = 'xmut' | ||
duration = timedelta(hours=1) | ||
validate_identity = DomainEmailValidator(['s.xmut.edu.cn']) | ||
|
||
|
||
urlpatterns = [ | ||
path('xmut/login/', LoginView.as_view()), | ||
path('xmut/get_code/', GetCodeView.as_view()), | ||
] |
62 changes: 62 additions & 0 deletions
62
frontend/migrations/0007_accountlog_specialprofileusedrecord_and_more.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# Generated by Django 4.2.5 on 2023-10-12 17:46 | ||
|
||
from django.conf import settings | ||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("auth", "0012_alter_user_first_name_max_length"), | ||
("frontend", "0006_credits"), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name="AccountLog", | ||
fields=[ | ||
( | ||
"id", | ||
models.AutoField( | ||
auto_created=True, | ||
primary_key=True, | ||
serialize=False, | ||
verbose_name="ID", | ||
), | ||
), | ||
("contents", models.TextField()), | ||
("content_type", models.CharField(default="学号", max_length=32)), | ||
( | ||
"account", | ||
models.OneToOneField( | ||
on_delete=django.db.models.deletion.CASCADE, | ||
to="frontend.account", | ||
), | ||
), | ||
], | ||
), | ||
migrations.CreateModel( | ||
name="SpecialProfileUsedRecord", | ||
fields=[ | ||
( | ||
"user", | ||
models.OneToOneField( | ||
on_delete=django.db.models.deletion.CASCADE, | ||
primary_key=True, | ||
serialize=False, | ||
to=settings.AUTH_USER_MODEL, | ||
), | ||
), | ||
], | ||
), | ||
migrations.RemoveField( | ||
model_name="ustcsnos", | ||
name="account", | ||
), | ||
migrations.DeleteModel( | ||
name="UstcEligible", | ||
), | ||
migrations.DeleteModel( | ||
name="UstcSnos", | ||
), | ||
] |
19 changes: 19 additions & 0 deletions
19
frontend/migrations/0008_accountlog_unique_account_log_for_each_type.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Generated by Django 4.2.5 on 2023-10-12 18:06 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("frontend", "0007_accountlog_specialprofileusedrecord_and_more"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddConstraint( | ||
model_name="accountlog", | ||
constraint=models.UniqueConstraint( | ||
fields=("account", "content_type"), | ||
name="unique_account_log_for_each_type", | ||
), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.