Skip to content
This repository has been archived by the owner on Nov 21, 2024. It is now read-only.

Commit

Permalink
Take care of case where event has no date
Browse files Browse the repository at this point in the history
  • Loading branch information
lioneltrebuchon committed Nov 24, 2019
1 parent f48523b commit bb7a65b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 4 additions & 2 deletions amivapi/events/email_links.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,10 @@ def on_delete_signup(token):
event_name = data_event["title_en"]
if event_name is None:
event_name = data_event["title_en"]
print(data_event["time_start"])
event_date = datetime.strftime(data_event["time_start"], '%Y-%m-%d %H:%M')
if data_event["time_start"] is None:
event_date = datetime.strftime(data_event["time_start"], '%Y-%m-%d %H:%M')
else:
event_date = "a yet undefined day."
# Serve the unregister_event page
response = make_response(render_template("unregister_event.html",
user=user,
Expand Down
2 changes: 0 additions & 2 deletions amivapi/events/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,6 @@
'description': 'Start time of the event itself. If you define '
'a start time, an end time is required, too.',
'example': '2018-10-17T18:00:00Z',

'type': 'datetime',
'nullable': True,
'default': None,
Expand All @@ -269,7 +268,6 @@
'description': 'End time of the event itself. If you define '
'an end time, a start time is required, too.',
'example': '2018-10-17T22:00:00Z',

'type': 'datetime',
'nullable': True,
'default': None,
Expand Down
2 changes: 1 addition & 1 deletion amivapi/events/templates/unregister_event.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ <h1>
</h1>
<p>
{% if user and event %}
We will irrevocably unregister you (<em>{{user}}</em>) from the event <em>{{event}}</em> on <em>{{event_date}}</em>.
We will irrevocably unregister you (<em>{{user}}</em>) from the event <em>{{event}}</em> on {{event_date}}.
Is that ok?
{% else %}
You clicked on a opt-out link of the AMIV at ETHZ student organization. We cannot process your request,
Expand Down

0 comments on commit bb7a65b

Please sign in to comment.