File tree 1 file changed +4
-2
lines changed
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 10
10
from rest_framework .response import Response
11
11
from rest_framework .views import APIView
12
12
from shared .api_archive .archive import ArchiveService , MinioEndpoints
13
- from shared .events .amplitude import AmplitudeEventPublisher
13
+ from shared .events .amplitude import UNKNOWN_USER_OWNERID , AmplitudeEventPublisher
14
14
from shared .metrics import inc_counter
15
15
from shared .upload .utils import UploaderType , insert_coverage_measurement
16
16
@@ -171,7 +171,9 @@ def send_analytics_data(
171
171
AmplitudeEventPublisher ().publish (
172
172
"Upload Sent" ,
173
173
{
174
- "user_ownerid" : commit .author .ownerid ,
174
+ "user_ownerid" : commit .author .ownerid
175
+ if commit .author
176
+ else UNKNOWN_USER_OWNERID ,
175
177
"ownerid" : commit .repository .author .ownerid ,
176
178
"repoid" : commit .repository .repoid ,
177
179
"commitid" : commit .id , # Not commit.commitid, we do not want a commit SHA here.
You can’t perform that action at this time.
0 commit comments