From c684c723c1b0210e3f8f359ea9fc39c45869e150 Mon Sep 17 00:00:00 2001 From: Arthur Deierlein Date: Mon, 22 Apr 2024 09:48:59 +0200 Subject: [PATCH] fix: drop customerpassword --- timed/projects/admin.py | 3 +-- timed/subscription/admin.py | 15 --------------- timed/subscription/models.py | 13 ------------- 3 files changed, 1 insertion(+), 30 deletions(-) diff --git a/timed/projects/admin.py b/timed/projects/admin.py index a1de3a66..b593da8a 100644 --- a/timed/projects/admin.py +++ b/timed/projects/admin.py @@ -9,7 +9,6 @@ from timed.forms import DurationInHoursField from timed.projects import models from timed.redmine.admin import RedmineProjectInline -from timed.subscription.admin import CustomerPasswordInline class CustomerAssigneeInline(admin.TabularInline): @@ -36,7 +35,7 @@ class CustomerAdmin(admin.ModelAdmin): list_display = ["name"] search_fields = ["name"] - inlines = [CustomerPasswordInline, CustomerAssigneeInline] + inlines = [CustomerAssigneeInline] def has_delete_permission(self, request, obj=None): return obj and not obj.projects.exists() diff --git a/timed/subscription/admin.py b/timed/subscription/admin.py index 63a4adaa..53f96022 100644 --- a/timed/subscription/admin.py +++ b/timed/subscription/admin.py @@ -1,5 +1,3 @@ -import hashlib - from django import forms from django.contrib import admin from django.utils.translation import gettext_lazy as _ @@ -18,16 +16,3 @@ class PackageForm(forms.ModelForm): class PackageAdmin(admin.ModelAdmin): list_display = ["billing_type", "duration", "price"] form = PackageForm - - -class CustomerPasswordForm(forms.ModelForm): - def save(self, commit=True): - password = self.cleaned_data.get("password") - if password is not None: - self.instance.password = hashlib.md5(password.encode()).hexdigest() - return super().save(commit=commit) - - -class CustomerPasswordInline(admin.StackedInline): - form = CustomerPasswordForm - model = models.CustomerPassword diff --git a/timed/subscription/models.py b/timed/subscription/models.py index 6c40bcc1..18d173e7 100644 --- a/timed/subscription/models.py +++ b/timed/subscription/models.py @@ -1,7 +1,6 @@ from django.conf import settings from django.db import models from django.utils import timezone -from django.utils.translation import gettext_lazy as _ from djmoney.models.fields import MoneyField @@ -40,15 +39,3 @@ class Order(models.Model): blank=True, related_name="orders_confirmed", ) - - -class CustomerPassword(models.Model): - """ - Password per customer used for login into SySupport portal. - - Password are only hashed with md5. This model will be obsolete - once customer center will go live. - """ - - customer = models.OneToOneField("projects.Customer", on_delete=models.CASCADE) - password = models.CharField(_("password"), max_length=128, null=True, blank=True)