Skip to content

Commit 4dc0247

Browse files
authored
fix: use approver's identity instead of System (ietf-tools#3701)
Fixes issue ietf-tools#3545 Conditionally tests if the approver is AnonymousUser, in which case System is still used
1 parent 916a3a0 commit 4dc0247

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

ietf/submit/utils.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
from django.http import HttpRequest # pyflakes:ignore
1919
from django.utils.module_loading import import_string
2020
from django.template.loader import render_to_string
21+
from django.contrib.auth.models import AnonymousUser
2122

2223
import debug # pyflakes:ignore
2324

@@ -330,11 +331,15 @@ def post_submission(request, submission, approved_doc_desc, approved_subm_desc):
330331
# Add all the previous submission events as docevents
331332
events += post_rev00_submission_events(draft, submission, submitter)
332333

334+
if isinstance(request.user, AnonymousUser):
335+
doer=system
336+
else:
337+
doer=request.user.person
333338
# Add an approval docevent
334339
e = SubmissionDocEvent.objects.create(
335340
type="new_submission",
336341
doc=draft,
337-
by=system,
342+
by=doer,
338343
desc=approved_doc_desc,
339344
submission=submission,
340345
rev=submission.rev,

0 commit comments

Comments
 (0)