File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
openedx/features/wikimedia_features Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change 1
1
import logging
2
2
from django .utils .functional import cached_property
3
+ from django .conf import settings
3
4
from social_core .exceptions import AuthException
4
5
from common .djangoapps .third_party_auth .identityserver3 import IdentityServer3
5
6
@@ -25,6 +26,15 @@ def _parse_name(self, name):
25
26
firstname = firstname if len (firstname )<= 30 else firstname [:30 ]
26
27
return fullname , firstname , lastname
27
28
29
+ def auth_headers (self ):
30
+ headers = super ().auth_headers ()
31
+ client = getattr (settings , "PLATFORM_NAME" , "wikilearn" )
32
+ site = getattr (settings , "LMS_ROOT_URL" , "https://learn.wiki/" )
33
+ contact_mail = getattr (settings , "CONTACT_EMAIL" , "comdevteam@wikimedia.org" )
34
+ headers ['User-Agent' ] = f'{ client } /0.13 ({ site } ; { contact_mail } )'
35
+
36
+ return headers
37
+
28
38
def get_user_details (self , response ):
29
39
"""
30
40
Returns detail about the user account from the service
You can’t perform that action at this time.
0 commit comments