From 01a271553ba06caafffcbe8c46e7245b9e1f7658 Mon Sep 17 00:00:00 2001 From: binaryfox Date: Sun, 15 Oct 2023 17:07:29 -0700 Subject: [PATCH] Show existing artists on the registration page (#95) Try to avoid artists accidentally creating multiple profiles if they don't intend to. --- artshow/register.py | 4 ++- .../artshow/manage_register_main.html | 34 ++++++++++++++++--- 2 files changed, 33 insertions(+), 5 deletions(-) diff --git a/artshow/register.py b/artshow/register.py index 98f6fe4..bebcdb0 100644 --- a/artshow/register.py +++ b/artshow/register.py @@ -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}) diff --git a/artshow/templates/artshow/manage_register_main.html b/artshow/templates/artshow/manage_register_main.html index a0325f8..759edc4 100644 --- a/artshow/templates/artshow/manage_register_main.html +++ b/artshow/templates/artshow/manage_register_main.html @@ -1,11 +1,37 @@ {% extends "artshow/manage_base.html" %} {% block content %}

- 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. +

+ +{% if artists %} +

You have already registered the following artist profiles:

+ + + + + + + {% for artist in artists %} + + + + + + {% endfor %} +
Artist NameArtist IDPieces Entered
{{ artist.artistname }}{{ artist.artistid }}{{ artist.piece_set.count }}
+ +

+ If you would like you create a separate artist profile to enter pieces under + a different public name, please fill in the form below: +

+{% else %} +

+ To register for the show, please fill in the following information to create + an artist profile:

-

Once there, you'll be able to request space in the show, provide payment for the space, enter piece - details, and so on.

+{% endif %}
{% csrf_token %}