forked from mozilla/zamboni
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 574276: Implemented the nickname blacklist.
- added the BlacklistedNickname model to the users app - updated the user registration form to check for blacklisted nicknames - admin add form for blacklisted nicknames - tests
- Loading branch information
Showing
8 changed files
with
236 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
{% extends "admin/base.html" %} | ||
{% from 'includes/forms.html' import required %} | ||
{% block extrahead %} | ||
{{ super() }} | ||
<link rel="stylesheet" href="{{ MEDIA_URL }}css/zamboni/admin-django.css"> | ||
{% endblock %} | ||
|
||
{% block title %}{{ page_title('Add Blacklisted Nicknames') }}{% endblock %} | ||
|
||
{% block bodyclass %}users-blacklistednickname change-form{% endblock %} | ||
|
||
{% block content %} | ||
|
||
<div class="breadcrumbs"> | ||
<a href="{{ url('admin:index') }}">Home</a> › | ||
<a href="{{ url('admin:app_list', app_label='users') }}">Users</a> › | ||
<a href="{{ url('admin:users_blacklistednickname_changelist') }}">Blacklisted nicknames</a> › | ||
Add | ||
</div> | ||
<div id="content" class="colM"> | ||
<h2>Add Blacklisted Nicknames</h2> | ||
<div id="content-main"> | ||
{% if messages %} | ||
{% for message in messages %} | ||
<div class="notification-box {{ message.tags }}"> | ||
<h2>{{ message }}</h2> | ||
</div> | ||
{% endfor %} | ||
{% endif %} | ||
|
||
{% if form %} | ||
<form method="post" action=""> | ||
{{ csrf() }} | ||
<p>Enter one nickname per line.</p> | ||
<div class="form-row"> | ||
{{ form.nicknames.errors|safe }} | ||
<label for="id_nicknames">Blacklisted Nicknames {{ required() }}</label> | ||
{{ form.nicknames|safe }} | ||
</div> | ||
<div class="submit-row"> | ||
<input type="submit" name="_save" class="default" value="Save"> | ||
</div> | ||
</form> | ||
{% endif %} | ||
</div> | ||
</div> | ||
|
||
{% endblock content %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
CREATE TABLE `users_blacklistednickname` ( | ||
`id` int(11) NOT NULL AUTO_INCREMENT, | ||
`created` datetime NOT NULL, | ||
`modified` datetime NOT NULL, | ||
`nickname` varchar(255) NOT NULL, | ||
PRIMARY KEY (`id`), | ||
UNIQUE KEY `nickname` (`nickname`) | ||
) ENGINE=InnoDB DEFAULT CHARSET=utf8; |