<s> from allauth . socialaccount import providers <EOL> from allauth . socialaccount . providers . base import ProviderAccount <EOL> from allauth . socialaccount . providers . oauth2 . provider import OAuth2Provider <EOL> class EdmodoAccount ( ProviderAccount ) : <EOL> def get_profile_url ( self ) : <EOL> return self . account . extra_data . get ( '<STR_LIT>' ) <EOL> def get_avatar_url ( self ) : <EOL> return self . account . extra_data . get ( '<STR_LIT>' ) <EOL> class EdmodoProvider ( OAuth2Provider ) : <EOL> id = '<STR_LIT>' <EOL> name = '<STR_LIT>' <EOL> account_class = EdmodoAccount <EOL> def get_default_scope ( self ) : <EOL> return [ '<STR_LIT>' ] <EOL> def extract_uid ( self , data ) : <EOL> return str ( data [ '<STR_LIT:id>' ] ) <EOL> def extract_common_fields ( self , data ) : <EOL> return dict ( first_name = data . get ( '<STR_LIT>' ) , <EOL> last_name = data . get ( '<STR_LIT>' ) , <EOL> email = data . get ( '<STR_LIT:email>' , '<STR_LIT>' ) ) <EOL> def extract_extra_data ( self , data ) : <EOL> return dict ( user_type = data . get ( '<STR_LIT:type>' ) , <EOL> profile_url = data . get ( '<STR_LIT:url>' ) , <EOL> avatar_url = data . get ( '<STR_LIT>' ) . get ( '<STR_LIT>' ) ) <EOL> providers . registry . register ( EdmodoProvider ) </s>
