Skip to content

Commit

Permalink
Fix missed URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
hieplpvip committed Sep 28, 2023
1 parent 970c451 commit ffb4b75
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 13 deletions.
2 changes: 1 addition & 1 deletion judge/sitemap.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class OrganizationSitemap(Sitemap):
priority = 0.5

def items(self):
return Organization.objects.values_list('id', 'slug')
return Organization.objects.values_list('slug')

def location(self, obj):
return reverse('organization_home', args=obj)
Expand Down
4 changes: 0 additions & 4 deletions judge/views/organization.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,6 @@ class OrganizationRequestForm(Form):

class RequestJoinOrganization(LoginRequiredMixin, SingleObjectMixin, FormView):
model = Organization
slug_field = 'key'
slug_url_kwarg = 'key'
template_name = 'organization/requests/request.html'
form_class = OrganizationRequestForm

Expand Down Expand Up @@ -224,8 +222,6 @@ def get_object(self, queryset=None):

class OrganizationRequestBaseView(LoginRequiredMixin, SingleObjectTemplateResponseMixin, SingleObjectMixin, View):
model = Organization
slug_field = 'key'
slug_url_kwarg = 'key'
tab = None

def get_object(self, queryset=None):
Expand Down
2 changes: 1 addition & 1 deletion templates/organization/requests/log.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<tr id="request-{{ r.id }}">
<td>{{ link_user(r.user) }}</td>
<td>
<a href="{{ url('request_organization_detail', object.id, object.slug, r.id) }}">
<a href="{{ url('request_organization_detail', object.slug, r.id) }}">
{{- r.time|date(_("N j, Y, H:i")) -}}
</a>
</td>
Expand Down
4 changes: 2 additions & 2 deletions templates/organization/requests/pending.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
{% for form in formset %}
<tr id="request-{{ form.instance.id }}">
<td>{{ form.id }}{{ link_user(form.instance.user) }}</td>
<td><a href="{{ url('request_organization_detail', object.id, object.slug, form.instance.id) }}">
<td><a href="{{ url('request_organization_detail', object.slug, form.instance.id) }}">
{{ form.instance.time|date(_("N j, Y, H:i")) }}
</a></td>
<td>{{ form.state }}</td>
Expand All @@ -36,4 +36,4 @@
{% else %}
<p>{{ _('There are no requests to approve.') }}</p>
{% endif %}
{% endblock %}
{% endblock %}
10 changes: 5 additions & 5 deletions templates/organization/requests/tabs.html
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<div class="tabs">
<ul>
<li{% if tab == 'pending' %} class="active"{% endif %}>
<a href="{{ url('organization_requests_pending', object.id, object.slug) }}">{{ _('Pending') }}</a>
<a href="{{ url('organization_requests_pending', object.slug) }}">{{ _('Pending') }}</a>
</li>
<li{% if tab == 'log' %} class="active"{% endif %}>
<a href="{{ url('organization_requests_log', object.id, object.slug) }}">{{ _('Log') }}</a>
<a href="{{ url('organization_requests_log', object.slug) }}">{{ _('Log') }}</a>
</li>
<li{% if tab == 'approved' %} class="active"{% endif %}>
<a href="{{ url('organization_requests_approved', object.id, object.slug) }}">{{ _('Approved') }}</a>
<a href="{{ url('organization_requests_approved', object.slug) }}">{{ _('Approved') }}</a>
</li>
<li{% if tab == 'rejected' %} class="active"{% endif %}>
<a href="{{ url('organization_requests_rejected', object.id, object.slug) }}">{{ _('Rejected') }}</a>
<a href="{{ url('organization_requests_rejected', object.slug) }}">{{ _('Rejected') }}</a>
</li>
</ul>
</div>
</div>

0 comments on commit ffb4b75

Please sign in to comment.