@@ -58,7 +58,7 @@ class PullRequestView(BaseAPIView):
58
58
def get (self ):
59
59
try :
60
60
pull = (
61
- PullRequest.objects .all()
61
+ PullRequest.query .all()
62
62
.visible_to_user(self .request.user)
63
63
.get(uuid = self .url_kwargs[" uuid" ])
64
64
)
@@ -124,7 +124,7 @@ class PullRequestView(BaseAPIView):
124
124
def get (self ):
125
125
try :
126
126
pull = (
127
- PullRequest.objects .all()
127
+ PullRequest.query .all()
128
128
.visible_to_user(self .request.user)
129
129
.get(uuid = self .url_kwargs[" uuid" ])
130
130
)
@@ -176,7 +176,7 @@ class PullRequestView(BaseAPIView):
176
176
def delete (self ):
177
177
try :
178
178
pull = (
179
- PullRequest.objects .all()
179
+ PullRequest.query .all()
180
180
.visible_to_user(self .request.user)
181
181
.get(uuid = self .url_kwargs[" uuid" ])
182
182
)
@@ -224,8 +224,8 @@ class User(models.Model):
224
224
Generating API keys is something you will need to do in your own code, wherever it makes sense to do so.
225
225
226
226
``` python
227
- user = User.objects .first()
228
- user.api_key = APIKey.objects .create()
227
+ user = User.query .first()
228
+ user.api_key = APIKey.query .create()
229
229
user.save()
230
230
```
231
231
@@ -321,12 +321,12 @@ class TeamAccountAPIView(BaseAPIView):
321
321
def team_account (self ):
322
322
try :
323
323
if self .organization:
324
- return TeamAccount.objects .get(
324
+ return TeamAccount.query .get(
325
325
team__organization = self .organization, uuid = self .url_kwargs[" uuid" ]
326
326
)
327
327
328
328
if self .request.user:
329
- return TeamAccount.objects .get(
329
+ return TeamAccount.query .get(
330
330
team__organization__in = self .request.user.organizations.all(),
331
331
uuid = self .url_kwargs[" uuid" ],
332
332
)
0 commit comments