Skip to content

Commit

Permalink
change the max length of emails to 150 characters everywhere
Browse files Browse the repository at this point in the history
  • Loading branch information
bdzim committed Oct 11, 2017
1 parent 49fecb5 commit bf6aa1b
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ apply_scripts:

manage:
cd ~/netkes/django/omva; \
. /etc/default/openmanage; python manage.py ${COMMAND}
sudo bash -c ". /etc/default/openmanage; python manage.py ${COMMAND}"

test_netkes:
. /etc/default/openmanage; python -m netkes/account_mgr/test/test_account_mgr
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-10-11 13:22
from __future__ import unicode_literals

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('blue_mgnt', '0003_invoicenote'),
]

operations = [
migrations.AlterField(
model_name='invoicenote',
name='note',
field=models.TextField(default=b'', help_text=b'An optional note that will appear on your invoices. Use this if you need to add an address, VAT number, or similar.'),
),
]
2 changes: 1 addition & 1 deletion django/apps/blue_management/blue_mgnt/views/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ def user_detail(request, api, account_info, config, username, email, saved=False
class UserForm(forms.Form):
if local_user:
name = forms.CharField(max_length=45)
email = forms.EmailField()
email = forms.EmailField(max_length=150)
group_id = forms.ChoiceField(local_groups, label='Group')
enabled = forms.BooleanField(required=False)
else:
Expand Down
2 changes: 1 addition & 1 deletion django/apps/blue_management/blue_mgnt/views/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def get_base_url(url=None):


class LoginForm(forms.Form):
username = forms.CharField(max_length=45)
username = forms.CharField(max_length=150)
password = forms.CharField(widget=forms.PasswordInput)


Expand Down
2 changes: 1 addition & 1 deletion django/apps/openmanage/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class Migration(migrations.Migration):
migrations.CreateModel(
name='Password',
fields=[
('email', models.CharField(max_length=64, serialize=False, primary_key=True)),
('email', models.CharField(max_length=150, serialize=False, primary_key=True)),
('pw_hash', models.CharField(max_length=128)),
],
options={
Expand Down
2 changes: 1 addition & 1 deletion django/apps/openmanage/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@


class Password(models.Model):
email = models.CharField(max_length=64, primary_key=True)
email = models.CharField(max_length=150, primary_key=True)
pw_hash = models.CharField(max_length=128)

def update_email(self, new_email):
Expand Down
6 changes: 6 additions & 0 deletions sql/2017-10-11_increase_password_email_length.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
begin;

alter table passwords alter column email type varchar(150);
alter table passwords owner to admin_console;

commit;
2 changes: 1 addition & 1 deletion sql/base_schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ CREATE USER directory_agent WITH PASSWORD 'initial';
CREATE USER admin_console WITH PASSWORD 'iexyjtso';

CREATE TABLE passwords (
email varchar(64) primary key,
email varchar(150) primary key,
pw_hash varchar(128)
);
GRANT SELECT, UPDATE, INSERT, DELETE ON passwords TO directory_agent;
Expand Down

0 comments on commit bf6aa1b

Please sign in to comment.