Skip to content

Commit

Permalink
Fix content type in post migrate handler
Browse files Browse the repository at this point in the history
  • Loading branch information
jackyyzhang03 committed Jun 29, 2023
1 parent e73ff46 commit 745098e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Migration(migrations.Migration):
),
migrations.AlterModelOptions(
name='user',
options={'permissions': (('view_user', 'View user'),)},
options={'permissions': (('view_user', 'View User'),)},
),
# Make sure there are no empty email fields by giving them a default value
migrations.RunSQL(
Expand Down
2 changes: 1 addition & 1 deletion rodan-main/code/rodan/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def add_view_user_permission(sender, **kwargs):
"""
# don't set permissions in test database
if not settings.TEST and sender.name == 'guardian':
content_type = ContentType.objects.get(app_label='auth', model='user')
content_type = ContentType.objects.get(app_label='rodan', model='user')
Permission.objects.get_or_create(codename='view_user', name='View User', content_type=content_type)

group = Group.objects.get_or_create(name="view_user_permission")
Expand Down
2 changes: 1 addition & 1 deletion rodan-main/code/rodan/models/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,5 @@ class User(AbstractUser):
class Meta:
db_table = "auth_user"
permissions = (
("view_user", "View user"),
("view_user", "View User"),
)

0 comments on commit 745098e

Please sign in to comment.