Skip to content

Commit

Permalink
users: {community,commercial}_terms_accepted
Browse files Browse the repository at this point in the history
We don't use the fields anymore.
  • Loading branch information
goneri committed Sep 13, 2024
1 parent 04e87cb commit b6928d3
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 19 deletions.
2 changes: 0 additions & 2 deletions ansible_ai_connect/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,6 @@ def setUp(self):
self.create_user()

self.user.user_id = str(uuid4())
self.user.community_terms_accepted = timezone.now()
self.user.save()

group_1, _ = Group.objects.get_or_create(name="Group 1")
group_2, _ = Group.objects.get_or_create(name="Group 2")
Expand Down
13 changes: 0 additions & 13 deletions ansible_ai_connect/users/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,27 +28,14 @@ class MembershipInline(admin.TabularInline):
extra = 0


class UserTermsResource(resources.ModelResource):
class Meta:
model = User
fields = ["username", "community_terms_accepted", "commercial_terms_accepted"]
name = "Export only user terms"


@admin.register(User)
class WisdomUserAdmin(ExportMixin, UserAdmin):
resource_classes = [UserTermsResource]
# add any additional fields you want to display in the User page
list_display = (
"username",
"is_staff",
"community_terms_accepted",
"commercial_terms_accepted",
"uuid",
)
fieldsets = UserAdmin.fieldsets + (
(None, {"fields": ("community_terms_accepted", "commercial_terms_accepted")}),
)
search_fields = UserAdmin.search_fields + ("uuid",)


Expand Down
2 changes: 0 additions & 2 deletions ansible_ai_connect/users/management/commands/createtoken.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,6 @@ def handle(
username=username,
password=password,
external_username=username,
community_terms_accepted=n,
commercial_terms_accepted=n,
)
if organization_id:
u.organization = Organization.objects.get_or_create(id=organization_id)[0]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Generated by Django 4.2.16 on 2024-09-13 21:05

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
("users", "0013_user_email_verified_user_family_name_user_given_name_and_more"),
]

operations = [
migrations.RemoveField(
model_name="user",
name="commercial_terms_accepted",
),
migrations.RemoveField(
model_name="user",
name="community_terms_accepted",
),
]
2 changes: 0 additions & 2 deletions ansible_ai_connect/users/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ class Plan(models.Model):

class User(ExportModelOperationsMixin("user"), AbstractUser):
uuid = models.UUIDField(unique=True, default=uuid.uuid4, editable=False)
community_terms_accepted = models.DateTimeField(default=None, null=True)
commercial_terms_accepted = models.DateTimeField(default=None, null=True)
organization_id = deprecate_field(models.IntegerField(default=None, null=True))
organization = NonClashingForeignKey(
Organization,
Expand Down

0 comments on commit b6928d3

Please sign in to comment.