tinybucket 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (138) hide show
  1. checksums.yaml +7 -0
  2. data/.coveralls.yml +1 -0
  3. data/.gitignore +35 -0
  4. data/.rspec +1 -0
  5. data/.rubocop.yml +44 -0
  6. data/.travis.yml +10 -0
  7. data/Gemfile +22 -0
  8. data/Guardfile +13 -0
  9. data/LICENSE +21 -0
  10. data/README.md +237 -0
  11. data/Rakefile +39 -0
  12. data/lib/faraday_middleware/follow_oauth_redirects.rb +67 -0
  13. data/lib/tinybucket.rb +61 -0
  14. data/lib/tinybucket/api.rb +20 -0
  15. data/lib/tinybucket/api/base_api.rb +31 -0
  16. data/lib/tinybucket/api/branch_restrictions_api.rb +26 -0
  17. data/lib/tinybucket/api/comments_api.rb +46 -0
  18. data/lib/tinybucket/api/commits_api.rb +26 -0
  19. data/lib/tinybucket/api/diff_api.rb +17 -0
  20. data/lib/tinybucket/api/helper.rb +22 -0
  21. data/lib/tinybucket/api/helper/api_helper.rb +48 -0
  22. data/lib/tinybucket/api/helper/branch_restrictions_helper.rb +27 -0
  23. data/lib/tinybucket/api/helper/comments_helper.rb +49 -0
  24. data/lib/tinybucket/api/helper/commits_helper.rb +27 -0
  25. data/lib/tinybucket/api/helper/diff_helper.rb +29 -0
  26. data/lib/tinybucket/api/helper/pull_requests_helper.rb +44 -0
  27. data/lib/tinybucket/api/helper/repo_helper.rb +29 -0
  28. data/lib/tinybucket/api/helper/repos_helper.rb +21 -0
  29. data/lib/tinybucket/api/helper/team_helper.rb +35 -0
  30. data/lib/tinybucket/api/helper/user_helper.rb +31 -0
  31. data/lib/tinybucket/api/pull_requests_api.rb +49 -0
  32. data/lib/tinybucket/api/repo_api.rb +35 -0
  33. data/lib/tinybucket/api/repos_api.rb +19 -0
  34. data/lib/tinybucket/api/team_api.rb +51 -0
  35. data/lib/tinybucket/api/user_api.rb +44 -0
  36. data/lib/tinybucket/api_factory.rb +21 -0
  37. data/lib/tinybucket/client.rb +95 -0
  38. data/lib/tinybucket/connection.rb +62 -0
  39. data/lib/tinybucket/constants.rb +4 -0
  40. data/lib/tinybucket/error.rb +8 -0
  41. data/lib/tinybucket/error/base_error.rb +12 -0
  42. data/lib/tinybucket/error/service_error.rb +20 -0
  43. data/lib/tinybucket/model.rb +20 -0
  44. data/lib/tinybucket/model/base.rb +54 -0
  45. data/lib/tinybucket/model/branch_restriction.rb +17 -0
  46. data/lib/tinybucket/model/comment.rb +39 -0
  47. data/lib/tinybucket/model/commit.rb +39 -0
  48. data/lib/tinybucket/model/concerns.rb +14 -0
  49. data/lib/tinybucket/model/concerns/reloadable.rb +45 -0
  50. data/lib/tinybucket/model/concerns/repository_keys.rb +43 -0
  51. data/lib/tinybucket/model/error_response.rb +7 -0
  52. data/lib/tinybucket/model/page.rb +65 -0
  53. data/lib/tinybucket/model/profile.rb +37 -0
  54. data/lib/tinybucket/model/pull_request.rb +64 -0
  55. data/lib/tinybucket/model/repository.rb +96 -0
  56. data/lib/tinybucket/model/team.rb +39 -0
  57. data/lib/tinybucket/parser.rb +25 -0
  58. data/lib/tinybucket/parser/base_parser.rb +17 -0
  59. data/lib/tinybucket/parser/branch_restriction_parser.rb +9 -0
  60. data/lib/tinybucket/parser/branch_restrictions_parser.rb +10 -0
  61. data/lib/tinybucket/parser/comment_parser.rb +9 -0
  62. data/lib/tinybucket/parser/comments_parser.rb +10 -0
  63. data/lib/tinybucket/parser/commit_parser.rb +9 -0
  64. data/lib/tinybucket/parser/commits_parser.rb +9 -0
  65. data/lib/tinybucket/parser/profile_parser.rb +9 -0
  66. data/lib/tinybucket/parser/profiles_parser.rb +9 -0
  67. data/lib/tinybucket/parser/pull_request_parser.rb +9 -0
  68. data/lib/tinybucket/parser/pull_requests_parser.rb +10 -0
  69. data/lib/tinybucket/parser/repo_parser.rb +9 -0
  70. data/lib/tinybucket/parser/repos_parser.rb +10 -0
  71. data/lib/tinybucket/parser/team_parser.rb +9 -0
  72. data/lib/tinybucket/parser/teams_parser.rb +9 -0
  73. data/lib/tinybucket/request.rb +55 -0
  74. data/lib/tinybucket/response.rb +7 -0
  75. data/lib/tinybucket/response/error_handler.rb +14 -0
  76. data/lib/tinybucket/version.rb +3 -0
  77. data/spec/fixtures/commit.json +83 -0
  78. data/spec/fixtures/profile.json +29 -0
  79. data/spec/fixtures/pull_request.json +106 -0
  80. data/spec/fixtures/repositories/get.json +78 -0
  81. data/spec/fixtures/repositories/test_owner/get.json +78 -0
  82. data/spec/fixtures/repositories/test_owner/test_repo/branch-restrictions/1/get.json +17 -0
  83. data/spec/fixtures/repositories/test_owner/test_repo/branch-restrictions/get.json +101 -0
  84. data/spec/fixtures/repositories/test_owner/test_repo/commit/1/comments/1/get.json +38 -0
  85. data/spec/fixtures/repositories/test_owner/test_repo/commit/1/comments/get.json +40 -0
  86. data/spec/fixtures/repositories/test_owner/test_repo/commit/1/get.json +83 -0
  87. data/spec/fixtures/repositories/test_owner/test_repo/commits/get.json +73 -0
  88. data/spec/fixtures/repositories/test_owner/test_repo/diff/1/get.json +21 -0
  89. data/spec/fixtures/repositories/test_owner/test_repo/forks/get.json +78 -0
  90. data/spec/fixtures/repositories/test_owner/test_repo/get.json +71 -0
  91. data/spec/fixtures/repositories/test_owner/test_repo/patch/1/get.json +29 -0
  92. data/spec/fixtures/repositories/test_owner/test_repo/pullrequests/1/approve/delete.json +3 -0
  93. data/spec/fixtures/repositories/test_owner/test_repo/pullrequests/1/approve/post.json +3 -0
  94. data/spec/fixtures/repositories/test_owner/test_repo/pullrequests/1/comments/1/get.json +30 -0
  95. data/spec/fixtures/repositories/test_owner/test_repo/pullrequests/1/comments/get.json +44 -0
  96. data/spec/fixtures/repositories/test_owner/test_repo/pullrequests/1/commits/get.json +66 -0
  97. data/spec/fixtures/repositories/test_owner/test_repo/pullrequests/1/diff/get.txt +13 -0
  98. data/spec/fixtures/repositories/test_owner/test_repo/pullrequests/1/get.json +164 -0
  99. data/spec/fixtures/repositories/test_owner/test_repo/pullrequests/get.json +112 -0
  100. data/spec/fixtures/repositories/test_owner/test_repo/pullrequests/get_state_declined.json +112 -0
  101. data/spec/fixtures/repositories/test_owner/test_repo/pullrequests/get_state_merged.json +112 -0
  102. data/spec/fixtures/repositories/test_owner/test_repo/pullrequests/get_state_open.json +112 -0
  103. data/spec/fixtures/repositories/test_owner/test_repo/watchers/get.json +32 -0
  104. data/spec/fixtures/repository.json +71 -0
  105. data/spec/fixtures/teams/test_team/followers/get.json +36 -0
  106. data/spec/fixtures/teams/test_team/following/get.json +39 -0
  107. data/spec/fixtures/teams/test_team/get.json +32 -0
  108. data/spec/fixtures/teams/test_team/members/get.json +36 -0
  109. data/spec/fixtures/teams/test_team/repositories/get.json +125 -0
  110. data/spec/fixtures/users/test_owner/followers/get.json +65 -0
  111. data/spec/fixtures/users/test_owner/following/get.json +100 -0
  112. data/spec/fixtures/users/test_owner/get.json +29 -0
  113. data/spec/lib/tinybucket/api/branch_restrictions_api_spec.rb +78 -0
  114. data/spec/lib/tinybucket/api/comments_api_spec.rb +133 -0
  115. data/spec/lib/tinybucket/api/commits_api_spec.rb +63 -0
  116. data/spec/lib/tinybucket/api/diff_api_spec.rb +5 -0
  117. data/spec/lib/tinybucket/api/pull_requests_api_spec.rb +229 -0
  118. data/spec/lib/tinybucket/api/repo_api_spec.rb +100 -0
  119. data/spec/lib/tinybucket/api/repos_api_spec.rb +28 -0
  120. data/spec/lib/tinybucket/api/team_api_spec.rb +87 -0
  121. data/spec/lib/tinybucket/api/user_api_spec.rb +60 -0
  122. data/spec/lib/tinybucket/api_factory_spec.rb +23 -0
  123. data/spec/lib/tinybucket/client_spec.rb +102 -0
  124. data/spec/lib/tinybucket/connection_spec.rb +30 -0
  125. data/spec/lib/tinybucket/model/branch_restriction_spec.rb +29 -0
  126. data/spec/lib/tinybucket/model/comment_spec.rb +31 -0
  127. data/spec/lib/tinybucket/model/commit_spec.rb +62 -0
  128. data/spec/lib/tinybucket/model/page_spec.rb +58 -0
  129. data/spec/lib/tinybucket/model/profile_spec.rb +47 -0
  130. data/spec/lib/tinybucket/model/pull_request_spec.rb +122 -0
  131. data/spec/lib/tinybucket/model/repository_spec.rb +131 -0
  132. data/spec/lib/tinybucket/model/team_spec.rb +53 -0
  133. data/spec/lib/tinybucket_spec.rb +32 -0
  134. data/spec/spec_helper.rb +42 -0
  135. data/spec/support/api_response_macros.rb +30 -0
  136. data/spec/support/model_macros.rb +61 -0
  137. data/tinybucket.gemspec +36 -0
  138. metadata +437 -0
@@ -0,0 +1,78 @@
1
+ {
2
+ "pagelen": 10,
3
+ "values": [
4
+ {
5
+ "scm": "git",
6
+ "has_wiki": false,
7
+ "description": "",
8
+ "links": {
9
+ "watchers": {
10
+ "href": "https://bitbucket.org/api/2.0/repositories/bnguyen/markdowndemo/watchers"
11
+ },
12
+ "commits": {
13
+ "href": "https://bitbucket.org/api/2.0/repositories/bnguyen/markdowndemo/commits"
14
+ },
15
+ "self": {
16
+ "href": "https://bitbucket.org/api/2.0/repositories/bnguyen/markdowndemo"
17
+ },
18
+ "html": {
19
+ "href": "https://bitbucket.org/bnguyen/markdowndemo"
20
+ },
21
+ "avatar": {
22
+ "href": "https://d3oaxc4q5k2d6q.cloudfront.net/m/f5a36db3429b/img/language-avatars/default_16.png"
23
+ },
24
+ "forks": {
25
+ "href": "https://bitbucket.org/api/2.0/repositories/bnguyen/markdowndemo/forks"
26
+ },
27
+ "clone": [
28
+ {
29
+ "href": "https://bitbucket.org/bnguyen/markdowndemo.git",
30
+ "name": "https"
31
+ },
32
+ {
33
+ "href": "ssh://git@bitbucket.org/bnguyen/markdowndemo.git",
34
+ "name": "ssh"
35
+ }
36
+ ],
37
+ "pullrequests": {
38
+ "href": "https://bitbucket.org/api/2.0/repositories/bnguyen/markdowndemo/pullrequests"
39
+ }
40
+ },
41
+ "fork_policy": "allow_forks",
42
+ "language": "",
43
+ "created_on": "2013-10-14T20:50:02.321710+00:00",
44
+ "parent": {
45
+ "links": {
46
+ "self": {
47
+ "href": "https://bitbucket.org/api/2.0/repositories/tutorials/markdowndemo"
48
+ },
49
+ "avatar": {
50
+ "href": "https://d3oaxc4q5k2d6q.cloudfront.net/m/f5a36db3429b/img/language-avatars/default_16.png"
51
+ }
52
+ },
53
+ "full_name": "tutorials/markdowndemo",
54
+ "name": "MarkdownDemo"
55
+ },
56
+ "full_name": "bnguyen/markdowndemo",
57
+ "has_issues": false,
58
+ "owner": {
59
+ "username": "bnguyen",
60
+ "display_name": "Brian Nguyen",
61
+ "links": {
62
+ "self": {
63
+ "href": "https://bitbucket.org/api/2.0/users/bnguyen"
64
+ },
65
+ "avatar": {
66
+ "href": "https://secure.gravatar.com/avatar/f7a8180e50193e2b1ececace9ca8d162?d=https%3A%2F%2Fd3oaxc4q5k2d6q.cloudfront.net%2Fm%2Ff5a36db3429b%2Fimg%2Fdefault_avatar%2F32%2Fuser_blue.png&s=32"
67
+ }
68
+ }
69
+ },
70
+ "updated_on": "2013-10-14T20:50:02.382945+00:00",
71
+ "size": 860675,
72
+ "is_private": false,
73
+ "name": "markdowndemo"
74
+ }
75
+ ],
76
+ "page": 1,
77
+ "size": 1
78
+ }
@@ -0,0 +1,71 @@
1
+ {
2
+ "scm": "git",
3
+ "has_wiki": false,
4
+ "description": "",
5
+ "links": {
6
+ "watchers": {
7
+ "href": "https://api.bitbucket.org/2.0/repositories/evzijst/atlassian-connect-fork/watchers"
8
+ },
9
+ "commits": {
10
+ "href": "https://api.bitbucket.org/2.0/repositories/evzijst/atlassian-connect-fork/commits"
11
+ },
12
+ "self": {
13
+ "href": "https://api.bitbucket.org/2.0/repositories/evzijst/atlassian-connect-fork"
14
+ },
15
+ "html": {
16
+ "href": "https://bitbucket.org/evzijst/atlassian-connect-fork"
17
+ },
18
+ "avatar": {
19
+ "href": "https://bitbucket.org/m/3a846b46851a/img/language-avatars/default_16.png"
20
+ },
21
+ "forks": {
22
+ "href": "https://api.bitbucket.org/2.0/repositories/evzijst/atlassian-connect-fork/forks"
23
+ },
24
+ "clone": [
25
+ {
26
+ "href": "https://bitbucket.org/evzijst/atlassian-connect-fork.git",
27
+ "name": "https"
28
+ },
29
+ {
30
+ "href": "ssh://git@bitbucket.org/evzijst/atlassian-connect-fork.git",
31
+ "name": "ssh"
32
+ }
33
+ ],
34
+ "pullrequests": {
35
+ "href": "https://api.bitbucket.org/2.0/repositories/evzijst/atlassian-connect-fork/pullrequests"
36
+ }
37
+ },
38
+ "fork_policy": "allow_forks",
39
+ "language": "",
40
+ "created_on": "2013-08-26T18:13:07.339080+00:00",
41
+ "parent": {
42
+ "links": {
43
+ "self": {
44
+ "href": "https://api.bitbucket.org/2.0/repositories/evzijst/atlassian-connect"
45
+ },
46
+ "avatar": {
47
+ "href": "https://bitbucket-assetroot.s3.amazonaws.com/m/3a846b46851a/img/language-avatars/default_16.png"
48
+ }
49
+ },
50
+ "full_name": "evzijst/atlassian-connect",
51
+ "name": "atlassian-connect"
52
+ },
53
+ "full_name": "evzijst/atlassian-connect-fork",
54
+ "has_issues": false,
55
+ "owner": {
56
+ "username": "evzijst",
57
+ "display_name": "Erik van Zijst",
58
+ "links": {
59
+ "self": {
60
+ "href": "https://api.bitbucket.org/2.0/users/evzijst"
61
+ },
62
+ "avatar": {
63
+ "href": "https://bitbucket-assetroot.s3.amazonaws.com/c/photos/2013/Oct/28/evzijst-avatar-3454044670-3_avatar.png"
64
+ }
65
+ }
66
+ },
67
+ "updated_on": "2013-08-26T18:13:07.514065+00:00",
68
+ "size": 17657351,
69
+ "is_private": false,
70
+ "name": "atlassian-connect-fork"
71
+ }
@@ -0,0 +1,29 @@
1
+ # HG changeset patch
2
+ # User Juan Borda <quiasmo.paprika@gmail.com>
3
+ # Date 1384880449 18000
4
+ # Node ID 6247bd81bdc2d254a6be8b00f28137aec7225cc2
5
+ # Parent 68599fa0e4054272d09e2e69a0f3beb9af903192
6
+ add churchill quote
7
+
8
+ diff --git a/index.html b/index.html
9
+ --- a/index.html
10
+ +++ b/index.html
11
+ @@ -55,7 +55,17 @@
12
+ -->
13
+ <!-- Quotes Table Start -->
14
+
15
+ -
16
+ + <tr>
17
+ + <td>
18
+ + <img src="http://4.bp.blogspot.com/-rTLW1af50AE/TnMnzam0g9I/AAAAAAAAAtk/y85tikqkPYg/s1600/estrategia_winston_churchill_diplomacia.jpg"/>
19
+ + </td>
20
+ + <td>
21
+ + <blockquote><p>"If you're going thru hell, keep going."</p>
22
+ + <cite>Wiston Churchill</cite>
23
+ + </blockquote>
24
+ + </td>
25
+ + </tr>
26
+ +
27
+ <tr>
28
+ <td>
29
+ <img src="http://upload.wikimedia.org/wikipedia/commons/thumb/b/b9/Steve_Jobs_Headshot_2010-CROP.jpg/250px-Steve_Jobs_Headshot_2010-CROP.jpg"/>
@@ -0,0 +1,30 @@
1
+ {
2
+ "links": {
3
+ "self": {
4
+ "href": "https://bitbucket.org/api/2.0/repositories/tutorials/tutorials.bitbucket.org/pullrequests/2821/comments/839163"
5
+ },
6
+ "html": {
7
+ "href": "https://bitbucket.org/tutorials/tutorials.bitbucket.org/pull-request/2821/_/diff#comment-839163"
8
+ }
9
+ },
10
+ "content": {
11
+ "raw": "this is my first comment",
12
+ "markup": "markdown",
13
+ "html": "<p>this is my first comment</p>"
14
+ },
15
+ "created_on": "2013-11-19T21:19:24.138375+00:00",
16
+ "user": {
17
+ "username": "tutorials",
18
+ "display_name": "first name last",
19
+ "links": {
20
+ "self": {
21
+ "href": "https://bitbucket.org/api/2.0/users/tutorials"
22
+ },
23
+ "avatar": {
24
+ "href": "https://bitbucket-assetroot.s3.amazonaws.com/c/photos/2013/Jul/17/tutorials-avatar-1826704565-4_avatar.png"
25
+ }
26
+ }
27
+ },
28
+ "updated_on": "2013-11-19T21:19:24.141013+00:00",
29
+ "id": 839163
30
+ }
@@ -0,0 +1,44 @@
1
+ {
2
+ "pagelen": 1,
3
+ "next": "https://bitbucket.org/api/2.0/repositories/bitbucket/bitbucket/pullrequests/3767/comments?pagelen=1&page=2",
4
+ "values": [{
5
+ "parent": {
6
+ "id": 25334,
7
+ "links": {
8
+ "self": {
9
+ "href": "https://bitbucket.org/api/2.0/repositories/bitbucket/bitbucket/pullrequests/3767/comments/25334"
10
+ }
11
+ }
12
+ },
13
+ "links": {
14
+ "self": {
15
+ "href": "https://bitbucket.org/api/2.0/repositories/bitbucket/bitbucket/pullrequests/3767/comments/25337"
16
+ },
17
+ "html": {
18
+ "href": "https://bitbucket.org/bitbucket/bitbucket/pull-request/3767/_/diff#comment-25337"
19
+ }
20
+ },
21
+ "content": {
22
+ "raw": "If we are leaving the email attached to the team account, Gravatar should still work fine. The problem would be they can't change the Gravatar associated account then.",
23
+ "markup": "markdown",
24
+ "html": "<p>If we are leaving the email attached to the team account, Gravatar should still work fine. The problem would be they can't change the Gravatar associated account then.</p>"
25
+ },
26
+ "created_on": "2013-11-07T17:11:20.986517+00:00",
27
+ "user": {
28
+ "username": "mfrauenholtz",
29
+ "display_name": "Michael Frauenholtz",
30
+ "links": {
31
+ "self": {
32
+ "href": "https://bitbucket.org/api/2.0/users/mfrauenholtz"
33
+ },
34
+ "avatar": {
35
+ "href": "https://bitbucket-staging-assetroot.s3.amazonaws.com/c/photos/2013/Aug/24/mfrauenholtz-avatar-1858533797-5_avatar.png"
36
+ }
37
+ }
38
+ },
39
+ "updated_on": "2013-11-07T17:11:20.989028+00:00",
40
+ "id": 25337
41
+ }],
42
+ "page": 1,
43
+ "size": 4
44
+ }
@@ -0,0 +1,66 @@
1
+ {
2
+ "pagelen": 1,
3
+ "next": "https://bitbucket.org/api/2.0/repositories/bitbucket/bitbucket/pullrequests/3764/commits?pagelen=1&page=2",
4
+ "values": [{
5
+ "hash": "ad758aeba36fa4b9d258ac1667f55cfb811e6df3",
6
+ "links": {
7
+ "self": {
8
+ "href": "https://bitbucket.org/api/2.0/repositories/bitbucket/bitbucket/commit/ad758aeba36fa4b9d258ac1667f55cfb811e6df3"
9
+ },
10
+ "comments": {
11
+ "href": "https://bitbucket.org/api/2.0/repositories/bitbucket/bitbucket/commit/ad758aeba36fa4b9d258ac1667f55cfb811e6df3/comments"
12
+ },
13
+ "patch": {
14
+ "href": "https://bitbucket.org/api/2.0/repositories/bitbucket/bitbucket/patch/ad758aeba36fa4b9d258ac1667f55cfb811e6df3"
15
+ },
16
+ "html": {
17
+ "href": "https://bitbucket.org/bitbucket/bitbucket/commits/ad758aeba36fa4b9d258ac1667f55cfb811e6df3"
18
+ },
19
+ "diff": {
20
+ "href": "https://bitbucket.org/api/2.0/repositories/bitbucket/bitbucket/diff/ad758aeba36fa4b9d258ac1667f55cfb811e6df3"
21
+ },
22
+ "approve": {
23
+ "href": "https://bitbucket.org/api/2.0/repositories/bitbucket/bitbucket/commit/ad758aeba36fa4b9d258ac1667f55cfb811e6df3/approve"
24
+ }
25
+ },
26
+ "repository": {
27
+ "links": {
28
+ "self": {
29
+ "href": "https://bitbucket.org/api/2.0/repositories/bitbucket/bitbucket"
30
+ },
31
+ "avatar": {
32
+ "href": "https://bitbucket-staging-assetroot.s3.amazonaws.com/c/photos/2013/Sep/27/bitbucket-logo-1832464563-7_avatar.png"
33
+ }
34
+ },
35
+ "full_name": "bitbucket/bitbucket",
36
+ "name": "bitbucket"
37
+ },
38
+ "author": {
39
+ "raw": "Erik van Zijst <erik.van.zijst@gmail.com>",
40
+ "user": {
41
+ "username": "erik",
42
+ "display_name": "Erik van Zijst",
43
+ "links": {
44
+ "self": {
45
+ "href": "https://bitbucket.org/api/2.0/users/erik"
46
+ },
47
+ "avatar": {
48
+ "href": "https://bitbucket-staging-assetroot.s3.amazonaws.com/c/photos/2013/Jul/31/erik-avatar-725122544-0_avatar.png"
49
+ }
50
+ }
51
+ }
52
+ },
53
+ "parents": [{
54
+ "hash": "16929c2f94828ca9d8adb5b91e7db7b274aae318",
55
+ "links": {
56
+ "self": {
57
+ "href": "https://bitbucket.org/api/2.0/repositories/bitbucket/bitbucket/commit/16929c2f94828ca9d8adb5b91e7db7b274aae318"
58
+ }
59
+ }
60
+ }],
61
+ "date": "2013-11-07T00:17:05+00:00",
62
+ "message": "Reorder imports. "
63
+ }],
64
+ "page": 1,
65
+ "size": 11
66
+ }
@@ -0,0 +1,13 @@
1
+ diff --git a/apps/account/forms.py b/apps/account/forms.py
2
+ index c2f3d2d..2c27220 100644
3
+ --- a/apps/account/forms.py
4
+ +++ b/apps/account/forms.py
5
+ @@ -553,6 +553,8 @@ class UsernameChangeForm(forms.Form):
6
+ raise TypeError("Keyword argument 'request' must be supplied")
7
+ super(UsernameChangeForm, self).__init__(*args, **kwargs)
8
+ self.request = request
9
+ + if request.target_user.get_profile().is_team:
10
+ + self.fields['username'].label = _('Team id')
11
+ if request.user == request.target_user:
12
+ self.fields['username'].help_text = _('You will need to log in '
13
+ 'again after making this '
@@ -0,0 +1,164 @@
1
+ {
2
+ "description": "![img](https://cloudup.com/c7ZJtChLw9J+) ## Removing: * Notifications * Email * Change password * Sessions ## Renaming: * Change username * Delete account (rename to delete team) ",
3
+ "links": {
4
+ "decline": {
5
+ "href": "https://staging.bitbucket.org/api/2.0/repositories/bitbucket/bitbucket/pullrequests/3767/decline"
6
+ },
7
+ "commits": {
8
+ "href": "https://staging.bitbucket.org/api/2.0/repositories/bitbucket/bitbucket/pullrequests/3767/commits"
9
+ },
10
+ "self": {
11
+ "href": "https://staging.bitbucket.org/api/2.0/repositories/bitbucket/bitbucket/pullrequests/3767"
12
+ },
13
+ "comments": {
14
+ "href": "https://staging.bitbucket.org/api/2.0/repositories/bitbucket/bitbucket/pullrequests/3767/comments"
15
+ },
16
+ "patch": {
17
+ "href": "https://staging.bitbucket.org/api/2.0/repositories/bitbucket/bitbucket/pullrequests/3767/patch"
18
+ },
19
+ "merge": {
20
+ "href": "https://staging.bitbucket.org/api/2.0/repositories/bucket/bitbucket/pullrequests/3767/merge"
21
+ },
22
+ "html": {
23
+ "href": "https://staging.bitbucket.org/bitbucket/bitbucket/pull-request/3767"
24
+ },
25
+ "activity": {
26
+ "href": "https://staging.bitbucket.org/api/2.0/repositories/bitbucket/bitbucket/pullrequests/3767/activity"
27
+ },
28
+ "diff": {
29
+ "href": "https://staging.bitbucket.org/api/2.0/repositories/bitbucket/bitbucket/pullrequests/3767/diff"
30
+ },
31
+ "approve": {
32
+ "href": "https://staging.bitbucket.org/api/2.0/repositories/bitbucket/bitbucket/pullrequests/3767/approve"
33
+ }
34
+ },
35
+ "title": "BB-9500: Remove certain admin links for Team accounts",
36
+ "close_source_branch": true,
37
+ "reviewers": [{
38
+ "username": "bnguyen",
39
+ "display_name": "Brian Nguyen",
40
+ "links": {
41
+ "self": {
42
+ "href": "https://staging.bitbucket.org/api/2.0/users/bnguyen"
43
+ },
44
+ "avatar": {
45
+ "href": "https://bitbucket-staging-assetroot.s3.amazonaws.com/c/photos/2013/Jul/24/bnguyen-avatar-124941034-2_avatar.png"
46
+ }
47
+ }
48
+ }],
49
+ "destination": {
50
+ "commit": {
51
+ "hash": "e04099ba977c",
52
+ "links": {
53
+ "self": {
54
+ "href": "https://staging.bitbucket.org/api/2.0/repositories/bitbucket/bitbucket/commit/e04099ba977c"
55
+ }
56
+ }
57
+ },
58
+ "repository": {
59
+ "links": {
60
+ "self": {
61
+ "href": "https://staging.bitbucket.org/api/2.0/repositories/bitbucket/bitbucket"
62
+ },
63
+ "avatar": {
64
+ "href": "https://bitbucket-staging-assetroot.s3.amazonaws.com/c/photos/2013/Sep/27/bitbucket-logo-1832464563-7_avatar.png"
65
+ }
66
+ },
67
+ "full_name": "bitbucket/bitbucket",
68
+ "name": "bitbucket"
69
+ },
70
+ "branch": {
71
+ "name": "staging"
72
+ }
73
+ },
74
+ "reason": "",
75
+ "closed_by": null,
76
+ "source": {
77
+ "commit": {
78
+ "hash": "2a81a1edc0c2",
79
+ "links": {
80
+ "self": {
81
+ "href": "https://staging.bitbucket.org/api/2.0/repositories/bitbucket/bitbucket/commit/2a81a1edc0c2"
82
+ }
83
+ }
84
+ },
85
+ "repository": {
86
+ "links": {
87
+ "self": {
88
+ "href": "https://staging.bitbucket.org/api/2.0/repositories/bitbucket/bitbucket"
89
+ },
90
+ "avatar": {
91
+ "href": "https://bitbucket-staging-assetroot.s3.amazonaws.com/c/photos/2013/Sep/27/bitbucket-logo-1832464563-7_avatar.png"
92
+ }
93
+ },
94
+ "full_name": "bitbucket/bitbucket",
95
+ "name": "bitbucket"
96
+ },
97
+ "branch": {
98
+ "name": "mfrauenholtz/team-removal/admin-links"
99
+ }
100
+ },
101
+ "state": "OPEN",
102
+ "author": {
103
+ "username": "mfrauenholtz",
104
+ "display_name": "Michael Frauenholtz",
105
+ "links": {
106
+ "self": {
107
+ "href": "https://staging.bitbucket.org/api/2.0/users/mfrauenholtz"
108
+ },
109
+ "avatar": {
110
+ "href": "https://bitbucket-staging-assetroot.s3.amazonaws.com/c/photos/2013/Aug/24/mfrauenholtz-avatar-1858533797-5_avatar.png"
111
+ }
112
+ }
113
+ },
114
+ "created_on": "2013-11-05T23:59:26.480984+00:00",
115
+ "participants": [{
116
+ "role": "PARTICIPANT",
117
+ "user": {
118
+ "username": "mfrauenholtz",
119
+ "display_name": "Michael Frauenholtz",
120
+ "links": {
121
+ "self": {
122
+ "href": "https://staging.bitbucket.org/api/2.0/users/mfrauenholtz"
123
+ },
124
+ "avatar": {
125
+ "href": "https://bitbucket-staging-assetroot.s3.amazonaws.com/c/photos/2013/Aug/24/mfrauenholtz-avatar-1858533797-5_avatar.png"
126
+ }
127
+ }
128
+ },
129
+ "approved": false
130
+ }, {
131
+ "role": "PARTICIPANT",
132
+ "user": {
133
+ "username": "dbennett",
134
+ "display_name": "Daniel Bennett",
135
+ "links": {
136
+ "self": {
137
+ "href": "https://staging.bitbucket.org/api/2.0/users/dbennett"
138
+ },
139
+ "avatar": {
140
+ "href": "https://bitbucket-staging-assetroot.s3.amazonaws.com/c/photos/2013/Aug/23/dbennett-avatar-2862131757-8_avatar.png"
141
+ }
142
+ }
143
+ },
144
+ "approved": false
145
+ }, {
146
+ "role": "REVIEWER",
147
+ "user": {
148
+ "username": "bnguyen",
149
+ "display_name": "Brian Nguyen",
150
+ "links": {
151
+ "self": {
152
+ "href": "https://staging.bitbucket.org/api/2.0/users/bnguyen"
153
+ },
154
+ "avatar": {
155
+ "href": "https://bitbucket-staging-assetroot.s3.amazonaws.com/c/photos/2013/Jul/24/bnguyen-avatar-124941034-2_avatar.png"
156
+ }
157
+ }
158
+ },
159
+ "approved": false
160
+ }],
161
+ "updated_on": "2013-11-07T00:17:41.061613+00:00",
162
+ "merge_commit": null,
163
+ "id": 1
164
+ }