Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CONCD-914 Update transcriptions dashboard #2499

Merged
merged 1 commit into from
Aug 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion concordia/admin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -781,7 +781,7 @@ class TranscriptionAdmin(admin.ModelAdmin):
"user",
"truncated_text",
"created_on",
"updated_on",
"campaign_slug",
"accepted",
"rejected",
"reviewed_by",
Expand Down
3 changes: 3 additions & 0 deletions concordia/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -956,6 +956,9 @@ class Meta:
def __str__(self):
return f"Transcription #{self.pk}"

def campaign_slug(self):
return self.asset.item.project.campaign.slug

def clean(self):
if (
self.user
Expand Down
5 changes: 5 additions & 0 deletions concordia/tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,11 @@ def setUp(self):
)
self.transcription2 = create_transcription(asset=self.asset, user=self.user2)

def test_campaign_slug(self):
self.assertEqual(
self.asset.item.project.campaign.slug, self.transcription1.campaign_slug()
)

def test_clean(self):
bad_transcription = Transcription(asset=self.asset, user=self.user)
bad_transcription.clean()
Expand Down
Loading