use 'nginx' as nginx running user

This commit is contained in:
zema1 2017-12-03 20:34:07 +08:00
parent 0f9f34df65
commit b5c0550652
2 changed files with 2 additions and 3 deletions

View File

@ -1,4 +1,4 @@
user nobody;
user nginx;
daemon off;
pid /tmp/nginx.pid;
worker_processes auto;
@ -20,7 +20,6 @@ http {
gzip on;
gzip_vary on;
gzip_types application/javascript text/css;
client_body_temp_path /tmp 1 2;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '

View File

@ -194,7 +194,7 @@ class ContestSubmissionListAPI(APIView):
# 封榜的时候只能看到自己的提交
if contest.rule_type == ContestRuleType.ACM:
if not contest.real_time_rank and not contest.is_contest_admin(request.user):
if not contest.real_time_rank and not request.user.is_contest_admin(contest):
submissions = submissions.filter(user_id=request.user.id)
data = self.paginate_data(request, submissions)