Skip to content

Commit

Permalink
Merge branch 'master' into redesign
Browse files Browse the repository at this point in the history
  • Loading branch information
minh-ton committed Jun 24, 2024
2 parents ab70d35 + 48af420 commit 8d88aaa
Show file tree
Hide file tree
Showing 12 changed files with 859 additions and 3 deletions.
2 changes: 2 additions & 0 deletions dmoj/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,8 @@
FONTAWESOME_CSS = '//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css'
DMOJ_CANONICAL = 'qhhoj.com'

SHORT_URL_LENGTH = 10

# Application definition

INSTALLED_APPS = ()
Expand Down
6 changes: 6 additions & 0 deletions dmoj/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from judge.views import TitledTemplateView, api, blog, comment, contests, language, license, mailgun, organization, \
preview, problem, problem_manage, ranked_submission, register, stats, status, submission, tag, tasks, ticket, \
two_factor, user, widgets
from judge.views.URL import redirect_url, shorten_url
from judge.views.about import AboutView
from judge.views.problem_data import ProblemDataView, ProblemSubmissionDiff, \
problem_data_file, problem_init_view
Expand Down Expand Up @@ -420,6 +421,11 @@ def paged_list_view(view, name):
path('failure', tasks.demo_failure),
path('progress', tasks.demo_progress),
])),

path('url/', include([
path('', shorten_url, name='shorten_url'),
path('<str:short_code>/', redirect_url, name='redirect_url'),
])),
]

favicon_paths = ['apple-touch-icon-180x180.png', 'apple-touch-icon-114x114.png', 'android-chrome-72x72.png',
Expand Down
3 changes: 2 additions & 1 deletion judge/admin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from judge.models import Badge, BlogPost, Comment, CommentLock, Contest, ContestParticipation, \
ContestTag, Judge, Language, License, MiscConfig, NavigationBar, Organization, \
OrganizationRequest, Problem, ProblemGroup, ProblemType, Profile, Submission, Tag, \
TagGroup, TagProblem, Ticket
TagGroup, TagProblem, Ticket, URL

admin.site.register(BlogPost, BlogPostAdmin)
admin.site.register(Comment, CommentAdmin)
Expand Down Expand Up @@ -47,3 +47,4 @@
admin.site.register(TagProblem, TagProblemAdmin)
admin.site.unregister(User)
admin.site.register(User, UserAdmin)
admin.site.register(URL)
Loading

0 comments on commit 8d88aaa

Please sign in to comment.