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})
|
||||
|
||||
def user_is_instructor(self, user: AbstractBaseUser) -> bool:
|
||||
if self.instructor is None:
|
||||
return False
|
||||
member = Member.from_user(user)
|
||||
if member is not None:
|
||||
return self.instructor.member == member
|
||||
|
@ -55,16 +55,22 @@
|
||||
<div class="vr d-none d-md-block m-4 p-0"></div>
|
||||
<div class="col-12 col-md-4">
|
||||
<div>
|
||||
<h3>From:</h3>
|
||||
<div>{{ event.instructor.member.account_name }}</div>
|
||||
<div>{{ event.instructor.member.address_street }}</div>
|
||||
<div>
|
||||
{{ event.instructor.member.address_city }},
|
||||
{{ event.instructor.member.address_state_province }}
|
||||
{{ event.instructor.member.address_postal_code }}
|
||||
</div>
|
||||
<div>{{ event.instructor.member.email }}</div>
|
||||
<div>{{ event.instructor.member.phone }}</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>
|
||||
<div>{{ event.instructor.member.account_name }}</div>
|
||||
<div>{{ event.instructor.member.address_street }}</div>
|
||||
<div>
|
||||
{{ event.instructor.member.address_city }},
|
||||
{{ event.instructor.member.address_state_province }}
|
||||
{{ event.instructor.member.address_postal_code }}
|
||||
</div>
|
||||
<div>{{ event.instructor.member.email }}</div>
|
||||
<div>{{ event.instructor.member.phone }}</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user