修复判断提交详情显示权限的问题
This commit is contained in:
@@ -114,9 +114,6 @@ def my_submission(request, submission_id):
|
|||||||
except Submission.DoesNotExist:
|
except Submission.DoesNotExist:
|
||||||
return error_page(request, u"提交不存在")
|
return error_page(request, u"提交不存在")
|
||||||
|
|
||||||
if submission.user_id != request.user.id and not submission.shared:
|
|
||||||
return error_page(request, u"提交不存在")
|
|
||||||
|
|
||||||
if submission.contest_id:
|
if submission.contest_id:
|
||||||
try:
|
try:
|
||||||
problem = ContestProblem.objects.get(id=submission.problem_id,
|
problem = ContestProblem.objects.get(id=submission.problem_id,
|
||||||
|
|||||||
@@ -62,7 +62,6 @@
|
|||||||
<div id="code-field">
|
<div id="code-field">
|
||||||
<textarea id="code-editor">{{ submission.code }}</textarea>
|
<textarea id="code-editor">{{ submission.code }}</textarea>
|
||||||
</div>
|
</div>
|
||||||
{% ifequal request.user.id submission.user_id %}
|
|
||||||
|
|
||||||
<div id="share-code" class="col-lg-6 col-md-6">
|
<div id="share-code" class="col-lg-6 col-md-6">
|
||||||
{% if submission.shared %}
|
{% if submission.shared %}
|
||||||
@@ -74,7 +73,7 @@
|
|||||||
{% if not submission.shared %}style="display: none" {% endif %}>{{ problem.title }}
|
{% if not submission.shared %}style="display: none" {% endif %}>{{ problem.title }}
|
||||||
{{ request.build_absolute_uri }}</textarea>
|
{{ request.build_absolute_uri }}</textarea>
|
||||||
</div>
|
</div>
|
||||||
{% endifequal %}
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user