File tree 2 files changed +8
-4
lines changed
2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change 11
11
from rest_framework .views import APIView
12
12
from shared .api_archive .archive import ArchiveService
13
13
from shared .bundle_analysis .storage import StoragePaths , get_bucket_name
14
- from shared .events .amplitude import AmplitudeEventPublisher
14
+ from shared .events .amplitude import UNKNOWN_USER_OWNERID , AmplitudeEventPublisher
15
15
from shared .metrics import Counter , inc_counter
16
16
17
17
from codecov_auth .authentication .repo_auth import (
@@ -224,7 +224,9 @@ def post(self, request: HttpRequest) -> Response:
224
224
AmplitudeEventPublisher ().publish (
225
225
"Upload Sent" ,
226
226
{
227
- "user_ownerid" : commit .author .ownerid if commit .author else - 1 ,
227
+ "user_ownerid" : commit .author .ownerid
228
+ if commit .author
229
+ else UNKNOWN_USER_OWNERID ,
228
230
"ownerid" : repo .author .ownerid ,
229
231
"repoid" : repo .repoid ,
230
232
"commitid" : commit .id , # Not commit.commitid, we do not want a commit SHA here!
Original file line number Diff line number Diff line change 8
8
from rest_framework .response import Response
9
9
from rest_framework .views import APIView
10
10
from shared .api_archive .archive import ArchiveService , MinioEndpoints
11
- from shared .events .amplitude import AmplitudeEventPublisher
11
+ from shared .events .amplitude import UNKNOWN_USER_OWNERID , AmplitudeEventPublisher
12
12
from shared .metrics import inc_counter
13
13
14
14
from codecov_auth .authentication .repo_auth import (
@@ -191,7 +191,9 @@ def post(self, request):
191
191
AmplitudeEventPublisher ().publish (
192
192
"Upload Sent" ,
193
193
{
194
- "user_ownerid" : commit .author .ownerid if commit .author else - 1 ,
194
+ "user_ownerid" : commit .author .ownerid
195
+ if commit .author
196
+ else UNKNOWN_USER_OWNERID ,
195
197
"ownerid" : repo .author .ownerid ,
196
198
"repoid" : repo .repoid ,
197
199
"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