diff --git a/docs/api/users.html b/docs/api/users.html index 684be566..9630c322 100644 --- a/docs/api/users.html +++ b/docs/api/users.html @@ -217,8 +217,8 @@
-
-GET /api/users/(user_id)
+
+GET /api/users/(user_name)

Get single user details

Example request:

GET /api/users/1 HTTP/1.1
@@ -264,7 +264,7 @@
 
Parameters
  • auth_user_id (integer) – authenticate user id (from JSON Web Token)

  • -
  • user_id (integer) – user id

  • +
  • user_name (integer) – user name

Request Headers
diff --git a/docs/http-routingtable.html b/docs/http-routingtable.html index ad846325..df318575 100644 --- a/docs/http-routingtable.html +++ b/docs/http-routingtable.html @@ -217,12 +217,12 @@ - GET /api/users/(user_id) + GET /api/users/(user_id)/picture - GET /api/users/(user_id)/picture + GET /api/users/(user_name) diff --git a/docs/objects.inv b/docs/objects.inv index 955063cf..a2cab175 100644 Binary files a/docs/objects.inv and b/docs/objects.inv differ diff --git a/docs/searchindex.js b/docs/searchindex.js index cef81bc3..938d9fb2 100644 --- a/docs/searchindex.js +++ b/docs/searchindex.js @@ -1 +1 @@ -Search.setIndex({docnames:["api/activities","api/auth","api/configuration","api/index","api/records","api/sports","api/stats","api/users","changelog","features","index","installation","troubleshooting/administrator","troubleshooting/index","troubleshooting/user"],envversion:{"sphinx.domains.c":1,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":1,"sphinx.domains.javascript":1,"sphinx.domains.math":2,"sphinx.domains.python":1,"sphinx.domains.rst":1,"sphinx.domains.std":1,sphinx:56},filenames:["api/activities.rst","api/auth.rst","api/configuration.rst","api/index.rst","api/records.rst","api/sports.rst","api/stats.rst","api/users.rst","changelog.md","features.rst","index.rst","installation.rst","troubleshooting/administrator.rst","troubleshooting/index.rst","troubleshooting/user.rst"],objects:{"":{"/api/activities":[0,1,1,"post--api-activities"],"/api/activities/(int:activity_id)":[0,3,1,"patch--api-activities-(int-activity_id)"],"/api/activities/(int:activity_id)/chart_data":[0,0,1,"get--api-activities-(int-activity_id)-chart_data"],"/api/activities/(int:activity_id)/chart_data/segment/(int:segment_id)":[0,0,1,"get--api-activities-(int-activity_id)-chart_data-segment-(int-segment_id)"],"/api/activities/(int:activity_id)/gpx":[0,0,1,"get--api-activities-(int-activity_id)-gpx"],"/api/activities/(int:activity_id)/gpx/segment/(int:segment_id)":[0,0,1,"get--api-activities-(int-activity_id)-gpx-segment-(int-segment_id)"],"/api/activities/map/(map_id)":[0,0,1,"get--api-activities-map-(map_id)"],"/api/activities/no_gpx":[0,1,1,"post--api-activities-no_gpx"],"/api/auth/login":[1,1,1,"post--api-auth-login"],"/api/auth/logout":[1,0,1,"get--api-auth-logout"],"/api/auth/picture":[1,1,1,"post--api-auth-picture"],"/api/auth/profile":[1,0,1,"get--api-auth-profile"],"/api/auth/profile/edit":[1,1,1,"post--api-auth-profile-edit"],"/api/auth/register":[1,1,1,"post--api-auth-register"],"/api/config":[2,3,1,"patch--api-config"],"/api/ping":[7,0,1,"get--api-ping"],"/api/records":[4,0,1,"get--api-records"],"/api/sports":[5,0,1,"get--api-sports"],"/api/sports/(int:sport_id)":[5,3,1,"patch--api-sports-(int-sport_id)"],"/api/stats/(int:user_id)/by_sport":[6,0,1,"get--api-stats-(int-user_id)-by_sport"],"/api/stats/(int:user_id)/by_time":[6,0,1,"get--api-stats-(int-user_id)-by_time"],"/api/stats/all":[6,0,1,"get--api-stats-all"],"/api/users":[7,0,1,"get--api-users"],"/api/users/(user_id)":[7,0,1,"get--api-users-(user_id)"],"/api/users/(user_id)/picture":[7,0,1,"get--api-users-(user_id)-picture"]}},objnames:{"0":["http","get","HTTP get"],"1":["http","post","HTTP post"],"2":["http","delete","HTTP delete"],"3":["http","patch","HTTP patch"]},objtypes:{"0":"http:get","1":"http:post","2":"http:delete","3":"http:patch"},terms:{"0mb":[0,1],"10mb":11,"1mb":11,"2e1ee2c":8,"34614d5":8,"4c3fc34":8,"boolean":2,"default":[0,6,11],"export":10,"float":0,"int":[0,5,6],"null":[0,1,7],"return":[0,4],"static":11,"true":[1,2,5,7,11],"try":[0,1],For:11,NOT:[0,1,5],Not:[0,1,5,6,7],That:1,The:[8,9,11],Use:8,accord:10,account:[8,9],acit:0,activ:[3,5,6,8,10],activity_d:[0,4],activity_id:[0,4],adapt:11,add:[8,9,10],admin:[1,2,5,7,8,9,11],administr:[0,1,8,9,10,13],again:[0,1,2,4,5,6,7],all:[4,5,6,7,11],allow:[0,1,2,10,11],alpinequest:10,alreadi:1,also:10,android:10,anymor:8,api:[0,1,2,4,5,6,7,8,9,10,11,12],app:[10,11],applic:[0,1,2,4,5,6,7,10,11],arch:11,archiv:[2,11],archlinux:11,ascent:0,auth:[0,1,2,4,5,6,7],auth_token:1,auth_user_id:[0,2,4,5,6,7],authent:[0,2,3,4,5,6,7,10],author:[0,1,2,4,5,6,7],avail:[4,9,10],ave_spe:0,ave_speed_from:0,ave_speed_to:0,averag:[0,4,8,9],b862a77:8,background:8,backup:11,bad:[0,1,2,5],bearer:[0,1,2,4,5,6,7],befor:11,beta:11,bike:[0,5,8,9],bio:[1,7],biographi:1,birth:1,birth_dat:[1,7],bound:0,build:11,by_sport:6,by_tim:6,calcul:8,calendar:[8,9],can:[8,9,10,11],cannot:8,chang:[9,10,11],charact:[1,13],chart:[0,8,9,11],chart_data:0,check:[7,12],choos:8,client:[8,11,12],clone:11,code:[0,1,2,4,5,6,7],color:8,column:13,com:[1,7,11],config:[2,11,12],configur:[3,10],confirm:1,contact:[0,1],contain:8,content:[0,1,2,4,5,6,7],coordin:11,copi:11,correctli:[8,12],creat:[0,1,8,9],created_at:[1,7],creation:[8,9],creation_d:0,credenti:1,current:8,custom:[11,12],cycl:[5,8,9],dai:8,dark:11,darkski:[8,9,11],dashboard:[8,10],data:[0,1,2,4,5,6,7,8,10,11,13],databas:11,date:[0,1,6,8,9],debian:11,defaut:11,defin:11,definit:8,delet:[0,1,8,9],depend:8,desc:0,descent:0,describ:11,descript:11,detail:[7,8,10],develop:10,differ:8,directori:11,disabl:[1,8,9],displai:[0,8,9,10,11],distanc:[0,4,8,9],distance_from:0,distance_to:0,document:[8,10,11],doe:[0,1,6,7,8],don:1,down:8,download:11,drop:8,durat:[0,4,8,9],duration_from:0,duration_to:0,dure:[0,1],edit:[1,8,9],elev:[0,8,9,11],email:[1,7,11],empti:8,enabl:2,encount:11,end:[0,6],endpoint:[3,7,13],english:9,enter:[8,9],entiti:[0,1],environ:10,environn:12,error:[0,1,2,5,8],europ:[1,7],even:[8,9],exampl:[0,1,2,4,5,6,7,10,11,12],exce:[0,1],exist:[0,1,6,7,10,12],exodu:10,expir:[0,1,2,4,5,6,7],extens:[0,1],fa33f4d996844a5c73ecd1ae24456ab8:0,fals:[0,1,2,5,7],farest:[4,8,9],featur:10,fetch:11,file:[0,1,2,8,9,10,11,12],filter:[8,9],first:[1,10],first_nam:[1,7],fittracke:[9,11],fittrackee_api:11,fix:10,flask:11,flaticon:11,follow:[4,11],forbidden:[0,1,2,5,6],forecast:11,form:[0,1],format:[0,1,6],former:11,forrunn:10,found:[0,1,5,6,7],frame:6,freepik:11,french:[9,10],fri:0,from:[0,2,4,5,6,7,10,11],gener:11,get:[0,1,2,4,5,6,7],gif:1,git:11,github:11,gmt:[0,1,4,7],gpl:10,gpx:[0,8,9,10,11],gpx_limit_import:2,gpxpy:11,has_act:5,have:[0,2,5,6,8],header:[0,1,2,4,5,6,7],health:7,hike:[5,8,9],his:[8,9],http:[0,1,2,4,5,6,7,11,12],i18n:8,icon:11,imag:[0,1,7,11],img:5,improv:10,incorrect:8,info:1,inform:[8,10],initi:[11,12],instal:10,instanc:[2,11],integ:[0,2,4,5,6,7],integr:2,interceptor:8,intern:[0,1,2,5],invalid:[0,1,2,4,5,6,7],is_act:5,is_registration_en:2,issu:[10,11],jan:0,javascript:11,jpeg:7,jpg:1,json:[0,1,2,4,5,6,7,13],jul:[0,1,4,7],keep:10,kei:[8,9,11],label:5,languag:[1,7],larg:[0,1],last:[1,11],last_nam:[1,7],latitud:0,leaflet:[0,11],least:0,limit:8,line:13,linux:11,list:[8,10],load:8,local:[8,10],localhost:[11,12],locat:[1,7],log:[0,1,2,4,5,6,7,10,11],login:[1,11],logout:[1,8],longest:[4,8,9],longitud:0,made:[11,12],mai:11,make:11,makefil:[11,12],manag:8,mandatori:[0,11],map:[0,8,9,10,11],map_id:0,match:1,max:[0,2,11],max_alt:0,max_single_file_s:2,max_spe:0,max_speed_from:0,max_speed_to:0,max_us:2,max_zip_file_s:2,maxim:0,maximum:[4,8,9],mean:12,messag:[0,1,7],min_alt:0,minim:0,minor:10,mobil:10,modification_d:0,mon:0,mondai:[1,6,9],montain:[8,9],month:[6,8,9],more:[8,10],morn:0,mountain:5,mous:8,move:[0,8],mpwoadmin:11,multipart:[0,1],must:[1,2,5,8,9,11],name:1,nb_activ:[1,6,7],nb_sport:[1,7],necessari:11,need:11,network:12,next_act:0,no_gpx:0,non:5,note:[0,8,9,11],now:[8,9,11],number:[0,2,11],oauth:[0,1,2,4,5,6,7],object:[0,1,2,5],one:0,onli:[0,8,9],open:[10,11],option:11,order:0,other:11,out:1,outdoor:10,over:8,own:10,owner:[8,9],packag:[8,11],page:0,pagin:0,paramet:[0,1,2,4,5,6,7],pari:[1,7],pars:[11,13],part:[0,1],password:[1,11],password_conf:1,past:11,patch:[0,2,5],paus:[0,8],payload:[0,1,2,5],per:0,per_pag:0,permiss:[0,2,5,6],pg_dump:11,pictur:[0,1,7,11],ping:7,pipenv:8,pleas:[0,1,2,4,5,6,7],png:[0,1,5],poetri:[8,11],point:8,pong:7,possibl:10,post:[0,1],postgresql:11,prefer:1,prerequisit:10,previous_act:0,privai:10,product:[10,11],profil:1,project:11,proprietari:10,provid:[0,1,2,4,5,6,7,8,9],pull:11,python:[8,11],queri:[0,6],react:11,react_app_allow_registr:11,react_app_api_url:12,react_app_gpx_limit_import:11,react_app_max_single_file_s:11,react_app_max_zip_file_s:11,react_app_thunderforest_api_kei:11,readi:[10,11],rebuild:12,rechart:[0,11],record:[0,3,8,9,10],record_typ:[0,4],redux:11,regist:[1,2,11],registr:[1,2,8,9],relat:11,releas:[10,11],replac:8,repo:11,report:10,repositori:11,request:[0,1,2,4,5,6,7,12],requir:1,respons:[0,1,2,4,5,6,7],restart:11,rout:8,run:[5,8,9,11],runner:10,sam:[1,7],same:8,samr1:11,sat:7,save:9,search:8,second:0,see:[8,9,10,11,12],segment:[0,8,9],segment_id:0,select:[0,1],serv:11,server:[0,1,2,5,10,11],set:[9,11],sever:10,show:8,side:8,signatur:[0,1,2,4,5,6,7],simplifi:8,sinc:11,singl:[2,7],size:[0,1,2,8,11],sky:11,some:[0,8,11],sorri:1,sort:0,speed:[0,4,8,9,11],spinner:8,sport:[0,3,6,8,9,10,11],sport_id:[0,4,5,6],sports_list:[1,7],standard:[8,9],start:[0,1,6,9,11],stat:[6,8],staticmap:11,statist:[3,10],statu:[0,1,2,4,5,6,7],step:11,still:10,stop:11,store:10,street:10,string:[0,1,5,6],success:[0,1,2,4,5,6,7],successfulli:1,sun:[0,1,4,7],sundai:[0,6,9],support:[8,9],system:11,tab:12,tar:11,test:11,than:8,them:10,thi:[0,8,10,11],thunderforest:11,time:[0,1,6,8,9],timezon:[1,7,8],titl:0,todo:[11,14],token:[0,1,2,4,5,6,7],too:[0,1],tooltip:8,total:8,total_dist:[1,6,7],total_dur:[1,6,7],track:10,tracker:10,transport:[5,8,9],troubleshoot:10,type:[0,1,2,4,5,6,7],unauthor:[0,1,2,4,5,6,7],undefin:12,under:10,unexpect:13,updat:[0,1,2,5,8,11],upgrad:10,upload:[8,9,11],url:8,user:[0,1,2,3,4,5,6,8,10,11,13],user_id:[0,4,6,7],usernam:[1,7],usernanm:1,using:[0,10],valid:[0,1,2,4,5,6,7],valu:[0,4,11],variabl:[10,12],version:[10,11],view:8,virtualenv:11,walk:[5,8,9],weather:[8,9,11],weather_api:11,weather_end:0,weather_start:0,web:[0,1,2,4,5,6,7,10],week:[1,6,8,9],weekend:8,weekm:[1,6],were:8,wget:11,when:8,which:9,wiki:8,with_gpx:0,without:[0,6,8,9,10],workout:10,written:11,www:11,xzf:11,yaourt:11,yarn:11,year:6,yet:[10,11],you:[0,2,5,6,10],your:10,zip:[0,2,11],zone:1},titles:["Activities","Authentication","Configuration","API documentation","Records","Sports","Statistics","Users","Change log","Features","FitTrackee","Installation","Administrator","Troubleshooting","User"],titleterms:{"new":8,activ:[0,9],administr:12,api:3,authent:1,avail:8,bug:8,chang:8,charact:12,close:8,column:12,configur:2,content:10,dashboard:9,data:12,detail:9,dev:11,document:3,environ:11,featur:[8,9],first:8,fittracke:[8,10],fix:8,french:8,improv:8,instal:11,issu:8,json:12,line:12,list:9,log:8,minor:8,misc:8,pars:12,prerequisit:11,prod:11,record:4,releas:8,sport:5,statist:[6,8,9],tabl:10,translat:9,troubleshoot:13,unexpect:12,upgrad:11,user:[7,9,14],variabl:11,version:8,workout:9}}) \ No newline at end of file +Search.setIndex({docnames:["api/activities","api/auth","api/configuration","api/index","api/records","api/sports","api/stats","api/users","changelog","features","index","installation","troubleshooting/administrator","troubleshooting/index","troubleshooting/user"],envversion:{"sphinx.domains.c":1,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":1,"sphinx.domains.javascript":1,"sphinx.domains.math":2,"sphinx.domains.python":1,"sphinx.domains.rst":1,"sphinx.domains.std":1,sphinx:56},filenames:["api/activities.rst","api/auth.rst","api/configuration.rst","api/index.rst","api/records.rst","api/sports.rst","api/stats.rst","api/users.rst","changelog.md","features.rst","index.rst","installation.rst","troubleshooting/administrator.rst","troubleshooting/index.rst","troubleshooting/user.rst"],objects:{"":{"/api/activities":[0,1,1,"post--api-activities"],"/api/activities/(int:activity_id)":[0,3,1,"patch--api-activities-(int-activity_id)"],"/api/activities/(int:activity_id)/chart_data":[0,0,1,"get--api-activities-(int-activity_id)-chart_data"],"/api/activities/(int:activity_id)/chart_data/segment/(int:segment_id)":[0,0,1,"get--api-activities-(int-activity_id)-chart_data-segment-(int-segment_id)"],"/api/activities/(int:activity_id)/gpx":[0,0,1,"get--api-activities-(int-activity_id)-gpx"],"/api/activities/(int:activity_id)/gpx/segment/(int:segment_id)":[0,0,1,"get--api-activities-(int-activity_id)-gpx-segment-(int-segment_id)"],"/api/activities/map/(map_id)":[0,0,1,"get--api-activities-map-(map_id)"],"/api/activities/no_gpx":[0,1,1,"post--api-activities-no_gpx"],"/api/auth/login":[1,1,1,"post--api-auth-login"],"/api/auth/logout":[1,0,1,"get--api-auth-logout"],"/api/auth/picture":[1,1,1,"post--api-auth-picture"],"/api/auth/profile":[1,0,1,"get--api-auth-profile"],"/api/auth/profile/edit":[1,1,1,"post--api-auth-profile-edit"],"/api/auth/register":[1,1,1,"post--api-auth-register"],"/api/config":[2,3,1,"patch--api-config"],"/api/ping":[7,0,1,"get--api-ping"],"/api/records":[4,0,1,"get--api-records"],"/api/sports":[5,0,1,"get--api-sports"],"/api/sports/(int:sport_id)":[5,3,1,"patch--api-sports-(int-sport_id)"],"/api/stats/(int:user_id)/by_sport":[6,0,1,"get--api-stats-(int-user_id)-by_sport"],"/api/stats/(int:user_id)/by_time":[6,0,1,"get--api-stats-(int-user_id)-by_time"],"/api/stats/all":[6,0,1,"get--api-stats-all"],"/api/users":[7,0,1,"get--api-users"],"/api/users/(user_id)/picture":[7,0,1,"get--api-users-(user_id)-picture"],"/api/users/(user_name)":[7,0,1,"get--api-users-(user_name)"]}},objnames:{"0":["http","get","HTTP get"],"1":["http","post","HTTP post"],"2":["http","delete","HTTP delete"],"3":["http","patch","HTTP patch"]},objtypes:{"0":"http:get","1":"http:post","2":"http:delete","3":"http:patch"},terms:{"0mb":[0,1],"10mb":11,"1mb":11,"2e1ee2c":8,"34614d5":8,"4c3fc34":8,"boolean":2,"default":[0,6,11],"export":10,"float":0,"int":[0,5,6],"null":[0,1,7],"return":[0,4],"static":11,"true":[1,2,5,7,11],"try":[0,1],For:11,NOT:[0,1,5],Not:[0,1,5,6,7],That:1,The:[8,9,11],Use:8,accord:10,account:[8,9],acit:0,activ:[3,5,6,8,10],activity_d:[0,4],activity_id:[0,4],adapt:11,add:[8,9,10],admin:[1,2,5,7,8,9,11],administr:[0,1,8,9,10,13],again:[0,1,2,4,5,6,7],all:[4,5,6,7,11],allow:[0,1,2,10,11],alpinequest:10,alreadi:1,also:10,android:10,anymor:8,api:[0,1,2,4,5,6,7,8,9,10,11,12],app:[10,11],applic:[0,1,2,4,5,6,7,10,11],arch:11,archiv:[2,11],archlinux:11,ascent:0,auth:[0,1,2,4,5,6,7],auth_token:1,auth_user_id:[0,2,4,5,6,7],authent:[0,2,3,4,5,6,7,10],author:[0,1,2,4,5,6,7],avail:[4,9,10],ave_spe:0,ave_speed_from:0,ave_speed_to:0,averag:[0,4,8,9],b862a77:8,background:8,backup:11,bad:[0,1,2,5],bearer:[0,1,2,4,5,6,7],befor:11,beta:11,bike:[0,5,8,9],bio:[1,7],biographi:1,birth:1,birth_dat:[1,7],bound:0,build:11,by_sport:6,by_tim:6,calcul:8,calendar:[8,9],can:[8,9,10,11],cannot:8,chang:[9,10,11],charact:[1,13],chart:[0,8,9,11],chart_data:0,check:[7,12],choos:8,client:[8,11,12],clone:11,code:[0,1,2,4,5,6,7],color:8,column:13,com:[1,7,11],config:[2,11,12],configur:[3,10],confirm:1,contact:[0,1],contain:8,content:[0,1,2,4,5,6,7],coordin:11,copi:11,correctli:[8,12],creat:[0,1,8,9],created_at:[1,7],creation:[8,9],creation_d:0,credenti:1,current:8,custom:[11,12],cycl:[5,8,9],dai:8,dark:11,darkski:[8,9,11],dashboard:[8,10],data:[0,1,2,4,5,6,7,8,10,11,13],databas:11,date:[0,1,6,8,9],debian:11,defaut:11,defin:11,definit:8,delet:[0,1,8,9],depend:8,desc:0,descent:0,describ:11,descript:11,detail:[7,8,10],develop:10,differ:8,directori:11,disabl:[1,8,9],displai:[0,8,9,10,11],distanc:[0,4,8,9],distance_from:0,distance_to:0,document:[8,10,11],doe:[0,1,6,7,8],don:1,down:8,download:11,drop:8,durat:[0,4,8,9],duration_from:0,duration_to:0,dure:[0,1],edit:[1,8,9],elev:[0,8,9,11],email:[1,7,11],empti:8,enabl:2,encount:11,end:[0,6],endpoint:[3,7,13],english:9,enter:[8,9],entiti:[0,1],environ:10,environn:12,error:[0,1,2,5,8],europ:[1,7],even:[8,9],exampl:[0,1,2,4,5,6,7,10,11,12],exce:[0,1],exist:[0,1,6,7,10,12],exodu:10,expir:[0,1,2,4,5,6,7],extens:[0,1],fa33f4d996844a5c73ecd1ae24456ab8:0,fals:[0,1,2,5,7],farest:[4,8,9],featur:10,fetch:11,file:[0,1,2,8,9,10,11,12],filter:[8,9],first:[1,10],first_nam:[1,7],fittracke:[9,11],fittrackee_api:11,fix:10,flask:11,flaticon:11,follow:[4,11],forbidden:[0,1,2,5,6],forecast:11,form:[0,1],format:[0,1,6],former:11,forrunn:10,found:[0,1,5,6,7],frame:6,freepik:11,french:[9,10],fri:0,from:[0,2,4,5,6,7,10,11],gener:11,get:[0,1,2,4,5,6,7],gif:1,git:11,github:11,gmt:[0,1,4,7],gpl:10,gpx:[0,8,9,10,11],gpx_limit_import:2,gpxpy:11,has_act:5,have:[0,2,5,6,8],header:[0,1,2,4,5,6,7],health:7,hike:[5,8,9],his:[8,9],http:[0,1,2,4,5,6,7,11,12],i18n:8,icon:11,imag:[0,1,7,11],img:5,improv:10,incorrect:8,info:1,inform:[8,10],initi:[11,12],instal:10,instanc:[2,11],integ:[0,2,4,5,6,7],integr:2,interceptor:8,intern:[0,1,2,5],invalid:[0,1,2,4,5,6,7],is_act:5,is_registration_en:2,issu:[10,11],jan:0,javascript:11,jpeg:7,jpg:1,json:[0,1,2,4,5,6,7,13],jul:[0,1,4,7],keep:10,kei:[8,9,11],label:5,languag:[1,7],larg:[0,1],last:[1,11],last_nam:[1,7],latitud:0,leaflet:[0,11],least:0,limit:8,line:13,linux:11,list:[8,10],load:8,local:[8,10],localhost:[11,12],locat:[1,7],log:[0,1,2,4,5,6,7,10,11],login:[1,11],logout:[1,8],longest:[4,8,9],longitud:0,made:[11,12],mai:11,make:11,makefil:[11,12],manag:8,mandatori:[0,11],map:[0,8,9,10,11],map_id:0,match:1,max:[0,2,11],max_alt:0,max_single_file_s:2,max_spe:0,max_speed_from:0,max_speed_to:0,max_us:2,max_zip_file_s:2,maxim:0,maximum:[4,8,9],mean:12,messag:[0,1,7],min_alt:0,minim:0,minor:10,mobil:10,modification_d:0,mon:0,mondai:[1,6,9],montain:[8,9],month:[6,8,9],more:[8,10],morn:0,mountain:5,mous:8,move:[0,8],mpwoadmin:11,multipart:[0,1],must:[1,2,5,8,9,11],name:[1,7],nb_activ:[1,6,7],nb_sport:[1,7],necessari:11,need:11,network:12,next_act:0,no_gpx:0,non:5,note:[0,8,9,11],now:[8,9,11],number:[0,2,11],oauth:[0,1,2,4,5,6,7],object:[0,1,2,5],one:0,onli:[0,8,9],open:[10,11],option:11,order:0,other:11,out:1,outdoor:10,over:8,own:10,owner:[8,9],packag:[8,11],page:0,pagin:0,paramet:[0,1,2,4,5,6,7],pari:[1,7],pars:[11,13],part:[0,1],password:[1,11],password_conf:1,past:11,patch:[0,2,5],paus:[0,8],payload:[0,1,2,5],per:0,per_pag:0,permiss:[0,2,5,6],pg_dump:11,pictur:[0,1,7,11],ping:7,pipenv:8,pleas:[0,1,2,4,5,6,7],png:[0,1,5],poetri:[8,11],point:8,pong:7,possibl:10,post:[0,1],postgresql:11,prefer:1,prerequisit:10,previous_act:0,privai:10,product:[10,11],profil:1,project:11,proprietari:10,provid:[0,1,2,4,5,6,7,8,9],pull:11,python:[8,11],queri:[0,6],react:11,react_app_allow_registr:11,react_app_api_url:12,react_app_gpx_limit_import:11,react_app_max_single_file_s:11,react_app_max_zip_file_s:11,react_app_thunderforest_api_kei:11,readi:[10,11],rebuild:12,rechart:[0,11],record:[0,3,8,9,10],record_typ:[0,4],redux:11,regist:[1,2,11],registr:[1,2,8,9],relat:11,releas:[10,11],replac:8,repo:11,report:10,repositori:11,request:[0,1,2,4,5,6,7,12],requir:1,respons:[0,1,2,4,5,6,7],restart:11,rout:8,run:[5,8,9,11],runner:10,sam:[1,7],same:8,samr1:11,sat:7,save:9,search:8,second:0,see:[8,9,10,11,12],segment:[0,8,9],segment_id:0,select:[0,1],serv:11,server:[0,1,2,5,10,11],set:[9,11],sever:10,show:8,side:8,signatur:[0,1,2,4,5,6,7],simplifi:8,sinc:11,singl:[2,7],size:[0,1,2,8,11],sky:11,some:[0,8,11],sorri:1,sort:0,speed:[0,4,8,9,11],spinner:8,sport:[0,3,6,8,9,10,11],sport_id:[0,4,5,6],sports_list:[1,7],standard:[8,9],start:[0,1,6,9,11],stat:[6,8],staticmap:11,statist:[3,10],statu:[0,1,2,4,5,6,7],step:11,still:10,stop:11,store:10,street:10,string:[0,1,5,6],success:[0,1,2,4,5,6,7],successfulli:1,sun:[0,1,4,7],sundai:[0,6,9],support:[8,9],system:11,tab:12,tar:11,test:11,than:8,them:10,thi:[0,8,10,11],thunderforest:11,time:[0,1,6,8,9],timezon:[1,7,8],titl:0,todo:[11,14],token:[0,1,2,4,5,6,7],too:[0,1],tooltip:8,total:8,total_dist:[1,6,7],total_dur:[1,6,7],track:10,tracker:10,transport:[5,8,9],troubleshoot:10,type:[0,1,2,4,5,6,7],unauthor:[0,1,2,4,5,6,7],undefin:12,under:10,unexpect:13,updat:[0,1,2,5,8,11],upgrad:10,upload:[8,9,11],url:8,user:[0,1,2,3,4,5,6,8,10,11,13],user_id:[0,4,6,7],user_nam:7,usernam:[1,7],usernanm:1,using:[0,10],valid:[0,1,2,4,5,6,7],valu:[0,4,11],variabl:[10,12],version:[10,11],view:8,virtualenv:11,walk:[5,8,9],weather:[8,9,11],weather_api:11,weather_end:0,weather_start:0,web:[0,1,2,4,5,6,7,10],week:[1,6,8,9],weekend:8,weekm:[1,6],were:8,wget:11,when:8,which:9,wiki:8,with_gpx:0,without:[0,6,8,9,10],workout:10,written:11,www:11,xzf:11,yaourt:11,yarn:11,year:6,yet:[10,11],you:[0,2,5,6,10],your:10,zip:[0,2,11],zone:1},titles:["Activities","Authentication","Configuration","API documentation","Records","Sports","Statistics","Users","Change log","Features","FitTrackee","Installation","Administrator","Troubleshooting","User"],titleterms:{"new":8,activ:[0,9],administr:12,api:3,authent:1,avail:8,bug:8,chang:8,charact:12,close:8,column:12,configur:2,content:10,dashboard:9,data:12,detail:9,dev:11,document:3,environ:11,featur:[8,9],first:8,fittracke:[8,10],fix:8,french:8,improv:8,instal:11,issu:8,json:12,line:12,list:9,log:8,minor:8,misc:8,pars:12,prerequisit:11,prod:11,record:4,releas:8,sport:5,statist:[6,8,9],tabl:10,translat:9,troubleshoot:13,unexpect:12,upgrad:11,user:[7,9,14],variabl:11,version:8,workout:9}}) \ No newline at end of file diff --git a/fittrackee_api/fittrackee_api/tests/test_users_api.py b/fittrackee_api/fittrackee_api/tests/test_users_api.py index 75559a45..b641bb21 100644 --- a/fittrackee_api/fittrackee_api/tests/test_users_api.py +++ b/fittrackee_api/fittrackee_api/tests/test_users_api.py @@ -13,7 +13,7 @@ def test_ping(app): assert 'success' in data['status'] -def test_single_user(app, user_1): +def test_single_user(app, user_1, user_2): """=> Get single user details""" client = app.test_client() resp_login = client.post( @@ -22,7 +22,7 @@ def test_single_user(app, user_1): content_type='application/json', ) response = client.get( - f'/api/users/{user_1.id}', + f'/api/users/{user_2.username}', content_type='application/json', headers=dict( Authorization='Bearer ' @@ -36,8 +36,8 @@ def test_single_user(app, user_1): assert len(data['data']['users']) == 1 user = data['data']['users'][0] - assert user['username'] == 'test' - assert user['email'] == 'test@test.com' + assert user['username'] == 'toto' + assert user['email'] == 'toto@toto.com' assert user['created_at'] assert not user['admin'] assert user['first_name'] is None @@ -71,7 +71,7 @@ def test_single_user_with_activities( content_type='application/json', ) response = client.get( - f'/api/users/{user_1.id}', + f'/api/users/{user_1.username}', content_type='application/json', headers=dict( Authorization='Bearer ' @@ -104,30 +104,7 @@ def test_single_user_with_activities( assert user['total_duration'] == '1:57:04' -def test_single_user_no_id(app, user_1): - """=> Ensure error is thrown if an id is not provided.""" - client = app.test_client() - resp_login = client.post( - '/api/auth/login', - data=json.dumps(dict(email='test@test.com', password='12345678')), - content_type='application/json', - ) - response = client.get( - '/api/users/blah', - content_type='application/json', - headers=dict( - Authorization='Bearer ' - + json.loads(resp_login.data.decode())['auth_token'] - ), - ) - data = json.loads(response.data.decode()) - - assert response.status_code == 404 - assert 'fail' in data['status'] - assert 'User does not exist.' in data['message'] - - -def test_single_user_wrong_id(app, user_1): +def test_single_user_no_existing(app, user_1): """=> Ensure error is thrown if the id does not exist.""" client = app.test_client() resp_login = client.post( @@ -136,7 +113,7 @@ def test_single_user_wrong_id(app, user_1): content_type='application/json', ) response = client.get( - '/api/users/99999999999', + '/api/users/not_existing', content_type='application/json', headers=dict( Authorization='Bearer ' diff --git a/fittrackee_api/fittrackee_api/users/users.py b/fittrackee_api/fittrackee_api/users/users.py index f6dbaf29..94e7c513 100644 --- a/fittrackee_api/fittrackee_api/users/users.py +++ b/fittrackee_api/fittrackee_api/users/users.py @@ -98,9 +98,9 @@ def get_users(auth_user_id): return jsonify(response_object), 200 -@users_blueprint.route('/users/', methods=['GET']) +@users_blueprint.route('/users/', methods=['GET']) @authenticate -def get_single_user(auth_user_id, user_id): +def get_single_user(auth_user_id, user_name): """ Get single user details @@ -149,7 +149,7 @@ def get_single_user(auth_user_id, user_id): } :param integer auth_user_id: authenticate user id (from JSON Web Token) - :param integer user_id: user id + :param integer user_name: user name :reqheader Authorization: OAuth 2.0 Bearer Token @@ -164,7 +164,7 @@ def get_single_user(auth_user_id, user_id): response_object = {'status': 'fail', 'message': 'User does not exist.'} try: - user = User.query.filter_by(id=int(user_id)).first() + user = User.query.filter_by(username=user_name).first() if not user: return jsonify(response_object), 404 else: diff --git a/fittrackee_client/src/components/Admin/Users/index.jsx b/fittrackee_client/src/components/Admin/Users/index.jsx index f2a839ac..84d2d401 100644 --- a/fittrackee_client/src/components/Admin/Users/index.jsx +++ b/fittrackee_client/src/components/Admin/Users/index.jsx @@ -41,7 +41,9 @@ class AdminUsers extends React.Component { {user.id} - {user.username} + + {user.username} + {user.email} diff --git a/fittrackee_client/src/components/App.jsx b/fittrackee_client/src/components/App.jsx index b1f84c98..c97c9ff4 100644 --- a/fittrackee_client/src/components/App.jsx +++ b/fittrackee_client/src/components/App.jsx @@ -48,7 +48,7 @@ class App extends React.Component { - + diff --git a/fittrackee_client/src/components/User/UserProfile.jsx b/fittrackee_client/src/components/User/UserProfile.jsx index 67ec8cc1..87df437a 100644 --- a/fittrackee_client/src/components/User/UserProfile.jsx +++ b/fittrackee_client/src/components/User/UserProfile.jsx @@ -7,12 +7,12 @@ import { getOrUpdateData } from '../../actions' class UserProfile extends React.Component { componentDidMount() { - this.props.loadUser(this.props.match.params.userId) + this.props.loadUser(this.props.match.params.userName) } componentDidUpdate(prevProps) { - if (prevProps.match.params.userId !== this.props.match.params.userId) { - this.props.loadUser(this.props.match.params.userId) + if (prevProps.match.params.userName !== this.props.match.params.userName) { + this.props.loadUser(this.props.match.params.userName) } } @@ -40,8 +40,8 @@ export default withTranslation()( users: state.users.data, }), dispatch => ({ - loadUser: userId => { - dispatch(getOrUpdateData('getData', 'users', { id: userId })) + loadUser: userName => { + dispatch(getOrUpdateData('getData', 'users', { username: userName })) }, }) )(UserProfile) diff --git a/fittrackee_client/src/fitTrackeeApi/index.js b/fittrackee_client/src/fitTrackeeApi/index.js index 2d9d98a1..a8c9c668 100644 --- a/fittrackee_client/src/fitTrackeeApi/index.js +++ b/fittrackee_client/src/fitTrackeeApi/index.js @@ -3,8 +3,8 @@ import { createApiRequest } from '../utils' export default class FitTrackeeApi { static getData(target, data = {}) { let url = target - if (data.id) { - url = `${url}/${data.id}` + if (data.id || (target === 'users' && data.username)) { + url = `${url}/${data.username ? data.username : data.id}` } else if (Object.keys(data).length > 0) { url += '?' Object.keys(data).map(key => (url += `&${key}=${data[key]}`))