Skip to content

Commit

Permalink
Tweak add many form to not include header row. Closes #829.
Browse files Browse the repository at this point in the history
  • Loading branch information
onyxfish committed Jul 16, 2012
1 parent edf0cb5 commit 81ace9c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
1 change: 0 additions & 1 deletion panda/admin.py
Expand Up @@ -233,7 +233,6 @@ def add_many(self, request, extra_context=None):
raise Exception('Unable to determine the format of the data you entered. Please ensure it is valid CSV data.')

reader = CSVKitReader(StringIO(user_data), dialect=csv_dialect)
reader.next()

emails = 0

Expand Down
7 changes: 4 additions & 3 deletions panda/templates/admin/panda/userproxy/add_many_form.html
Expand Up @@ -36,7 +36,7 @@
{% endblock %}
{% url 'admin:panda_userproxy_add_many' as form_url %}

<form action="{{ form_url }}" method="post" id="add_many_form">{% block form_top %}{% csrf_token %}<p>{% trans "Type or paste user data into the field below in <strong>CSV format</strong>. The provided header row is required. The first_name and last_name fields may be blank left blank for any or all rows." %}</p>
<form action="{{ form_url }}" method="post" id="add_many_form">{% block form_top %}{% csrf_token %}<p>{% trans "Type or paste user data into the field below in <strong>CSV format</strong>. The first_name and last_name fields may be blank left blank for any or all rows." %}</p>
<p>{% if email_enabled %}{% trans "If the password field is not blank the user will be activated immediately, otherwise the user will be sent an activation email." %}{% else %}{% trans "<strong>Important:</strong> Email is not <a href=\"/admin/settings/\">enabled</a> for your PANDA. <strong>Users will not receive activation emails.</strong> If the password field is not blank the user will be activated, otherwise you will need to activate them manually." %}{% endif %}</p>{% endblock %}
<div>

Expand All @@ -46,8 +46,9 @@
</p>
{% endif %}

<textarea name="user-data" rows="20", cols="100" value="">{% if user_data %}{% autoescape off %}{{ user_data }}{% endautoescape %}{% else %}email,password,first_name,last_name
example@example.com,mypass123,John,Doe{% endif %}</textarea><br />
<p><strong><code>email,password,first_name,last_name</code></strong></p>

<textarea name="user-data" rows="20", cols="100" value="">{% if user_data %}{% autoescape off %}{{ user_data }}{% endautoescape %}{% else %}example@example.com,mypass123,John,Doe{% endif %}</textarea><br />
<input type="submit" value="Add new users" />

{% for fieldset in adminform %}
Expand Down

0 comments on commit 81ace9c

Please sign in to comment.