def resolve_participants(self, info): user = info.context.user if not has_owner_permission(user, self.owner): return None if not self.ticket_product: return None tickets = self.ticket_product.ticket_set.filter(status=Ticket.STATUS_PAID) return [t.owner.profile for t in tickets]
def resolve_ticket(self, info, global_id=None, id=None): ticket = None if global_id: ticket = Ticket.objects.get(pk=from_global_id(global_id)[1]) if id: ticket = Ticket.objects.get(pk=id) if not ticket: return None if not has_owner_permission(info.context.user, ticket.owner): raise PermissionDenied() return ticket
def resolve_organization(self, info): if has_owner_permission(info.context.user, self.user): return self.organization return ''
def resolve_phone(self, info): if has_owner_permission(info.context.user, self.user): return self.phone return ''
def resolve_email(self, info): if has_owner_permission(info.context.user, self.user): return self.email return ''
def resolve_slide_url(self, info): if timezone.now() > self.finished_at: return self.slide_url if has_owner_permission(info.context.user, self.owner): return self.slide_url return ''
def resolve_owner(self, info): if has_owner_permission(info.context.user, self.owner): return self.owner return None
def resolve_comment(self, info): if has_owner_permission(info.context.user, self.owner): return self.comment return ''