Skip to content

Commit

Permalink
Show existing artists on the registration page (#95)
Browse files Browse the repository at this point in the history
Try to avoid artists accidentally creating multiple profiles if they
don't intend to.
  • Loading branch information
binaryf0x committed Oct 16, 2023
1 parent 56cb738 commit 01a2715
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 5 deletions.
4 changes: 3 additions & 1 deletion artshow/register.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ def main(request):
artist_form = ArtistRegisterForm()
agreement_form = AgreementForm()

artists = Artist.objects.viewable_by(request.user)
return render(request, "artshow/manage_register_main.html",
{"artist_form": artist_form,
{"artists": artists,
"artist_form": artist_form,
"agreement_form": agreement_form})
34 changes: 30 additions & 4 deletions artshow/templates/artshow/manage_register_main.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,37 @@
{% extends "artshow/manage_base.html" %}
{% block content %}
<p>
Welcome to the Art Show! To register for space in the show, please fill in
the following information.
Welcome to the Art Show! Most of your details have been copied from your
convention registration.
</p>

{% if artists %}
<p>You have already registered the following artist profiles:</p>
<table>
<tr>
<th>Artist Name</th>
<th>Artist ID</th>
<th>Pieces Entered</th>
</tr>
{% for artist in artists %}
<tr>
<td><a href="{% url 'artshow-manage-artist' artist.pk %}">{{ artist.artistname }}</a></td>
<td>{{ artist.artistid }}</td>
<td>{{ artist.piece_set.count }}</td>
</tr>
{% endfor %}
</table>

<p>
If you would like you create a separate artist profile to enter pieces under
a different public name, please fill in the form below:
</p>
{% else %}
<p>
To register for the show, please fill in the following information to create
an artist profile:
<p>
<p>Once there, you'll be able to request space in the show, provide payment for the space, enter piece
details, and so on.</p>
{% endif %}

<form method="post">{% csrf_token %}
<table>
Expand Down

0 comments on commit 01a2715

Please sign in to comment.