Merge branch 'master' into edit_link
This commit is contained in:
commit
572026aecd
13 changed files with 867 additions and 229 deletions
|
@ -18,6 +18,7 @@ from judge.models import (
|
|||
Submission,
|
||||
Ticket,
|
||||
)
|
||||
from judge.models.profile import Organization, OrganizationProfile
|
||||
from judge.utils.cachedict import CacheDict
|
||||
from judge.utils.diggpaginator import DiggPaginator
|
||||
from judge.utils.problems import user_completed_ids
|
||||
|
@ -73,10 +74,14 @@ class FeedView(ListView):
|
|||
.filter(is_visible=True)
|
||||
.order_by("start_time")
|
||||
)
|
||||
|
||||
context["current_contests"] = visible_contests.filter(
|
||||
start_time__lte=now, end_time__gt=now
|
||||
)
|
||||
context["future_contests"] = visible_contests.filter(start_time__gt=now)
|
||||
context[
|
||||
"recent_organizations"
|
||||
] = OrganizationProfile.get_most_recent_organizations(self.request.profile)
|
||||
context["top_rated"] = Profile.objects.filter(is_unlisted=False).order_by(
|
||||
"-rating"
|
||||
)[:10]
|
||||
|
|
|
@ -57,6 +57,7 @@ from judge.models import (
|
|||
Contest,
|
||||
Notification,
|
||||
ContestProblem,
|
||||
OrganizationProfile,
|
||||
)
|
||||
from judge import event_poster as event
|
||||
from judge.utils.ranker import ranker
|
||||
|
@ -150,6 +151,11 @@ class OrganizationMixin(OrganizationBase):
|
|||
return HttpResponsePermanentRedirect(
|
||||
request.get_full_path().replace(kwargs["slug"], self.organization.slug)
|
||||
)
|
||||
if self.request.user.is_authenticated:
|
||||
OrganizationProfile.add_organization(
|
||||
self.request.profile, self.organization
|
||||
)
|
||||
|
||||
return super(OrganizationMixin, self).dispatch(request, *args, **kwargs)
|
||||
|
||||
|
||||
|
|
|
@ -438,7 +438,7 @@ def edit_profile(request):
|
|||
form.fields["test_site"].initial = request.user.has_perm("judge.test_site")
|
||||
|
||||
tzmap = settings.TIMEZONE_MAP
|
||||
print(settings.REGISTER_NAME_URL)
|
||||
|
||||
return render(
|
||||
request,
|
||||
"user/edit-profile.html",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue