membershipworks: Handle events without instructors better
This commit is contained in:
parent
b1daa21e2c
commit
0f30358357
@ -556,6 +556,8 @@ class EventExt(Event):
|
|||||||
return reverse("membershipworks:event-detail", kwargs={"eid": self.eid})
|
return reverse("membershipworks:event-detail", kwargs={"eid": self.eid})
|
||||||
|
|
||||||
def user_is_instructor(self, user: AbstractBaseUser) -> bool:
|
def user_is_instructor(self, user: AbstractBaseUser) -> bool:
|
||||||
|
if self.instructor is None:
|
||||||
|
return False
|
||||||
member = Member.from_user(user)
|
member = Member.from_user(user)
|
||||||
if member is not None:
|
if member is not None:
|
||||||
return self.instructor.member == member
|
return self.instructor.member == member
|
||||||
|
@ -55,6 +55,11 @@
|
|||||||
<div class="vr d-none d-md-block m-4 p-0"></div>
|
<div class="vr d-none d-md-block m-4 p-0"></div>
|
||||||
<div class="col-12 col-md-4">
|
<div class="col-12 col-md-4">
|
||||||
<div>
|
<div>
|
||||||
|
{% if event.instructor is None %}
|
||||||
|
<div>No instructor has been defined for this event</div>
|
||||||
|
{% elif event.instructor.member is None %}
|
||||||
|
<div>Instructor is not a member, so no address information is known</div>
|
||||||
|
{% else %}
|
||||||
<h3>From:</h3>
|
<h3>From:</h3>
|
||||||
<div>{{ event.instructor.member.account_name }}</div>
|
<div>{{ event.instructor.member.account_name }}</div>
|
||||||
<div>{{ event.instructor.member.address_street }}</div>
|
<div>{{ event.instructor.member.address_street }}</div>
|
||||||
@ -65,6 +70,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div>{{ event.instructor.member.email }}</div>
|
<div>{{ event.instructor.member.email }}</div>
|
||||||
<div>{{ event.instructor.member.phone }}</div>
|
<div>{{ event.instructor.member.phone }}</div>
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user