forked from GithubBackups/healthchecks
Prepare for the removal of Check.user_id and Channel.user_id
This commit is contained in:
parent
e1b999e83a
commit
caf6668478
@ -170,9 +170,8 @@ class Check(models.Model):
|
||||
return "up"
|
||||
|
||||
def assign_all_channels(self):
|
||||
if self.user:
|
||||
channels = Channel.objects.filter(user=self.user)
|
||||
self.channel_set.add(*channels)
|
||||
channels = Channel.objects.filter(project=self.project)
|
||||
self.channel_set.add(*channels)
|
||||
|
||||
def tags_list(self):
|
||||
return [t.strip() for t in self.tags.split(" ") if t.strip()]
|
||||
@ -293,7 +292,7 @@ class Channel(models.Model):
|
||||
}
|
||||
|
||||
def assign_all_checks(self):
|
||||
checks = Check.objects.filter(user=self.user)
|
||||
checks = Check.objects.filter(project=self.project)
|
||||
self.checks.add(*checks)
|
||||
|
||||
def make_token(self):
|
||||
|
@ -374,7 +374,7 @@ class Sms(HttpTransport):
|
||||
return check.status != "down"
|
||||
|
||||
def notify(self, check):
|
||||
profile = Profile.objects.for_user(self.channel.user)
|
||||
profile = Profile.objects.for_user(self.channel.project.owner)
|
||||
if not profile.authorize_sms():
|
||||
return "Monthly SMS limit exceeded"
|
||||
|
||||
|
@ -148,7 +148,7 @@ def status(request, username):
|
||||
if not _has_access(request, username):
|
||||
raise Http404("not found")
|
||||
|
||||
checks = list(Check.objects.filter(user__username=username))
|
||||
checks = list(Check.objects.filter(project__owner__username=username))
|
||||
|
||||
details = []
|
||||
for check in checks:
|
||||
|
Loading…
x
Reference in New Issue
Block a user