Skip to content

Commit

Permalink
Resolve UserMetadata issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron Kanzer authored and Aaron Kanzer committed Sep 16, 2024
1 parent 9d388d0 commit ee11e9e
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion dandiapi/api/tests/test_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,16 @@ def test_stats_user(api_client, user_factory):
for _ in range(users_per_status):
username = f'{status_value.lower()}_user_{user_index}'
user = user_factory(username=username)
UserMetadata.objects.create(user=user, status=status_value)
user_metadata, created = UserMetadata.objects.get_or_create(
user=user,
defaults={
'status': status_value,
'questionnaire_form': None,
'rejection_reason': ''
}
)
if not created:
pass
if status_value == UserMetadata.Status.APPROVED:
approved_user_count += 1
user_index += 1
Expand Down

0 comments on commit ee11e9e

Please sign in to comment.