-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: removing djangoapp
demographics
, step 1 (#35182)
* feat: removing djangoapp `demographics`, step 1 This step removes the models, the references to the models, and adds a migration to drop both tables (`HistoricalUserDemographics` didn't have a corresponding model but was still a valid table). Once this has deployed, this will be removed from `INSTALLED_APPS` and completely removed. No other apps in the repository currently reference this djangoapp in code or tables. FIXES: APER-3560
- Loading branch information
Showing
8 changed files
with
31 additions
and
178 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,3 @@ | ||
""" | ||
Django admin page for demographics | ||
""" | ||
|
||
from django.contrib import admin | ||
|
||
from openedx.core.djangoapps.demographics.models import UserDemographics | ||
|
||
|
||
class UserDemographicsAdmin(admin.ModelAdmin): | ||
""" | ||
Admin for UserDemographics Model | ||
""" | ||
list_display = ('id', 'user', 'show_call_to_action') | ||
readonly_fields = ('user',) | ||
search_fields = ('id', 'user__username') | ||
|
||
class Meta: | ||
model = UserDemographics | ||
|
||
|
||
admin.site.register(UserDemographics, UserDemographicsAdmin) |
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
23 changes: 23 additions & 0 deletions
23
openedx/core/djangoapps/demographics/migrations/0005_remove_demographics_models.py
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,23 @@ | ||
# Generated by Django 4.2.14 on 2024-07-25 15:19 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('demographics', '0004_alter_historicaluserdemographics_options'), | ||
] | ||
|
||
operations = [ | ||
migrations.RemoveField( | ||
model_name='userdemographics', | ||
name='user', | ||
), | ||
migrations.DeleteModel( | ||
name='HistoricalUserDemographics', | ||
), | ||
migrations.DeleteModel( | ||
name='UserDemographics', | ||
), | ||
] |
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 |
---|---|---|
@@ -1,30 +1,3 @@ | ||
""" | ||
Demographics models | ||
""" | ||
|
||
from django.contrib.auth import get_user_model | ||
from django.db import models | ||
from model_utils.models import TimeStampedModel | ||
from simple_history.models import HistoricalRecords | ||
|
||
User = get_user_model() | ||
|
||
|
||
class UserDemographics(TimeStampedModel): | ||
""" | ||
A Users Demographics platform related data in support of the Demographics | ||
IDA and features | ||
.. no_pii: | ||
""" | ||
user = models.OneToOneField(User, on_delete=models.CASCADE) | ||
show_call_to_action = models.BooleanField(default=True) | ||
history = HistoricalRecords(app='demographics') | ||
|
||
class Meta: | ||
app_label = "demographics" | ||
verbose_name = "user demographic" | ||
verbose_name_plural = "user demographic" | ||
|
||
def __str__(self): | ||
return f'UserDemographics for {self.user}' |
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
Empty file.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.