Skip to content

Commit

Permalink
Merge pull request #44 from edx/schen/MST-1002
Browse files Browse the repository at this point in the history
fix: Update the django admin for Name Verification to be editable
  • Loading branch information
schenedx committed Aug 31, 2021
2 parents 72dcb5b + be3ab92 commit f14ec76
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ Change Log
Unreleased
~~~~~~~~~~
[0.8.2] - 2021-08-31
~~~~~~~~~~~~~~~~~~~~
* Update django admin to allow editing of VerifiedName and VerifiedNameConfig

[0.8.1] - 2021-08-30
~~~~~~~~~~~~~~~~~~~~
Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ requirements: ## install development environment requirements
pip install -qr requirements/pip-tools.txt
pip-sync requirements/dev.txt requirements/private.*

requirements.test: requirements ## install test environment requriements
pip install -qr requirements/test.txt

test: clean ## run tests in the current virtualenv
pytest

Expand Down
2 changes: 1 addition & 1 deletion edx_name_affirmation/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
Django app housing name affirmation logic.
"""

__version__ = '0.8.1'
__version__ = '0.8.2'

default_app_config = 'edx_name_affirmation.apps.EdxNameAffirmationConfig' # pylint: disable=invalid-name
4 changes: 3 additions & 1 deletion edx_name_affirmation/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ class VerifiedNameAdmin(admin.ModelAdmin):
'id', 'user', 'verified_name', 'verification_attempt_id', 'proctored_exam_attempt_id',
'status', 'created', 'modified',
)
readonly_fields = ('id', 'user', 'created', 'modified')
readonly_fields = ('id',)
search_fields = ('user__username', 'verification_attempt_id', 'proctored_exam_attempt_id',)
raw_id_fields = ('user', )


class VerifiedNameConfigAdmin(admin.ModelAdmin):
Expand All @@ -28,6 +29,7 @@ class VerifiedNameConfigAdmin(admin.ModelAdmin):
)
readonly_fields = ('change_date',)
search_fields = ('user__username',)
raw_id_fields = ('user', )


admin.site.register(VerifiedName, VerifiedNameAdmin)
Expand Down
23 changes: 23 additions & 0 deletions edx_name_affirmation/migrations/0006_auto_20210830_2029.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Generated by Django 2.2.24 on 2021-08-30 20:29

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('edx_name_affirmation', '0005_remove_verifiedname_is_verified'),
]

operations = [
migrations.AlterField(
model_name='verifiedname',
name='proctored_exam_attempt_id',
field=models.PositiveIntegerField(blank=True, null=True),
),
migrations.AlterField(
model_name='verifiedname',
name='verification_attempt_id',
field=models.PositiveIntegerField(blank=True, null=True),
),
]
4 changes: 2 additions & 2 deletions edx_name_affirmation/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ class VerifiedName(TimeStampedModel):
profile_name = models.CharField(max_length=255, null=True)

# Reference to an external ID verification or proctored exam attempt
verification_attempt_id = models.PositiveIntegerField(null=True)
proctored_exam_attempt_id = models.PositiveIntegerField(null=True)
verification_attempt_id = models.PositiveIntegerField(null=True, blank=True)
proctored_exam_attempt_id = models.PositiveIntegerField(null=True, blank=True)

status = models.CharField(
max_length=32,
Expand Down

0 comments on commit f14ec76

Please sign in to comment.