diff options
Diffstat (limited to 'tools/pharos-dashboard/booking/models.py')
-rw-r--r-- | tools/pharos-dashboard/booking/models.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/pharos-dashboard/booking/models.py b/tools/pharos-dashboard/booking/models.py index 719dd9bf..8011fa41 100644 --- a/tools/pharos-dashboard/booking/models.py +++ b/tools/pharos-dashboard/booking/models.py @@ -10,6 +10,7 @@ class Booking(models.Model): resource = models.ForeignKey(Resource, models.PROTECT) start = models.DateTimeField() end = models.DateTimeField() + jira_issue_id = models.IntegerField(null=True) purpose = models.CharField(max_length=300, blank=False) @@ -25,11 +26,10 @@ class Booking(models.Model): if user.has_perm('booking.add_booking'): return True # Check if User owns this resource - if user in self.resource.owners.all(): + if user == self.resource.owner: return True return False - def save(self, *args, **kwargs): """ Save the booking if self.user is authorized and there is no overlapping booking. |