From 47564afcc25b48d42c76613899b96b9826b3cfc4 Mon Sep 17 00:00:00 2001 From: Filipp Lepalaan Date: Fri, 14 Aug 2015 15:21:30 +0300 Subject: Remove GSX password fields --- servo/forms/account.py | 2 -- servo/migrations/0024_auto_20150813_1048.py | 22 ++++++++++++++++++++++ servo/models/account.py | 7 +------ servo/models/common.py | 18 +++--------------- 4 files changed, 26 insertions(+), 23 deletions(-) create mode 100644 servo/migrations/0024_auto_20150813_1048.py (limited to 'servo') diff --git a/servo/forms/account.py b/servo/forms/account.py index 775069e..8cb3719 100644 --- a/servo/forms/account.py +++ b/servo/forms/account.py @@ -47,11 +47,9 @@ class ProfileForm(BaseModelForm): "autoprint", "tech_id", "gsx_userid", - "gsx_password", "gsx_poprefix", ) widgets = { - 'gsx_password': forms.PasswordInput, 'queues': forms.CheckboxSelectMultiple } diff --git a/servo/migrations/0024_auto_20150813_1048.py b/servo/migrations/0024_auto_20150813_1048.py new file mode 100644 index 0000000..080ac38 --- /dev/null +++ b/servo/migrations/0024_auto_20150813_1048.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('servo', '0023_auto_20150612_0822'), + ] + + operations = [ + migrations.RemoveField( + model_name='gsxaccount', + name='password', + ), + migrations.RemoveField( + model_name='user', + name='gsx_password', + ), + ] diff --git a/servo/models/account.py b/servo/models/account.py index 883a877..a51a340 100644 --- a/servo/models/account.py +++ b/servo/models/account.py @@ -153,12 +153,7 @@ class User(AbstractUser): max_length=128, verbose_name=_("User ID") ) - gsx_password = models.CharField( - blank=True, - default='', - max_length=256, - verbose_name=_("Password") - ) + gsx_poprefix = models.CharField( blank=True, default='', diff --git a/servo/models/common.py b/servo/models/common.py index 58b7427..3c06d84 100644 --- a/servo/models/common.py +++ b/servo/models/common.py @@ -220,13 +220,6 @@ class GsxAccount(models.Model): verbose_name=_("User ID") ) - password = models.CharField( - blank=True, - default='', - max_length=256, - verbose_name=_("Password") - ) - environment = models.CharField( max_length=2, verbose_name=_("Environment"), @@ -289,8 +282,6 @@ class GsxAccount(models.Model): """ if user.gsx_userid: self.user_id = user.gsx_userid - if user.gsx_password: - self.password = user.gsx_password if location is None: timezone = user.location.gsx_tz @@ -298,7 +289,6 @@ class GsxAccount(models.Model): timezone = location.gsx_tz gsxws.connect(user_id=self.user_id, - password=self.password, sold_to=self.sold_to, environment=self.environment, timezone=timezone) @@ -308,11 +298,9 @@ class GsxAccount(models.Model): """ Tests that the account details are correct """ - if self.user_id and self.password: - gsxws.connect(sold_to=self.sold_to, - user_id=self.user_id, - password=self.password, - environment=self.environment) + gsxws.connect(sold_to=self.sold_to, + user_id=self.user_id, + environment=self.environment) def get_admin_url(self): return reverse('admin-edit_gsx_account', args=[self.pk]) -- cgit v1.2.3