{% extends "layout.html" %}
{% block content %}
    <h1>Welcome {{ current_user.username }}</h1>
    <div class="container-narrow">
        {% if meals|length > 0 %}
        <h1>Your Upcoming Meals</h1>
        <ul>
        {% for meal in meals %}
        <li><a href="{{ url_for('meal.show', uid=meal.id) }}">Meal</a></li>
        {% endfor %}
        </ul>
        {% else %}
        <a href="{{ url_for('public.home') }}">You haven't joined any meals. Find one now</a>
        {% endif %}
        <br/>
        <a href="{{ url_for('location.mine') }}">
        {% if current_user and not current_user.location.address %}
        Become a host
        {% else %}
        Manage meals you are hosting
        {% endif %}
        </a>
    </div>
{% endblock %}

{% extends "layout.html" %}
{% block content %}
    <h1>Welcome {{ current_user.username }}</h1>
    <div class="container-narrow">
        {% if meals|length > 0 %}
        <h1>Your Upcoming Meals</h1>
        <ul>
        {% for meal in meals %}
        <li><a href="{{ url_for('meal.show', uid=meal.id) }}">Meal</a></li>
        {% endfor %}
        </ul>
        {% else %}
        <a href="{{ url_for('public.home') }}">You haven't joined any meals. Find one now</a>
        {% endif %}
        <br/>
        {% if current_user and not current_user.location.address %}
        <a href="{{ url_for('location.edit') }}">Become a host</a>
        {% else %}
        <a href="{{ url_for('location.mine') }}">Manage meals you are hosting</a>
        {% endif %}
    </div>
{% endblock %}

Send to location.edit if user doesn't have an address, instead of location.mine
Send to location.edit if user doesn't have an address, instead of location.mine
