Skip to content

Commit

Permalink
Merge pull request #1702 from CentreForDigitalHumanities/feature/dedu…
Browse files Browse the repository at this point in the history
…plicate-corpora

Feature/deduplicate corpora
  • Loading branch information
Meesch authored Nov 21, 2024
2 parents 7d6d098 + f3c80e1 commit 7280eea
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion backend/users/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def searchable_corpora(self):
if self.is_superuser:
return Corpus.objects.filter(active=True)

return Corpus.objects.filter(active=True, groups__user=self)
return Corpus.objects.filter(active=True, groups__user=self).distinct()


class AnoymousProfile(object):
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/app/services/corpus.service.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable @typescript-eslint/member-ordering */
import { Injectable } from '@angular/core';

import { BehaviorSubject } from 'rxjs';
import { BehaviorSubject, lastValueFrom } from 'rxjs';

import {
Corpus,
Expand Down Expand Up @@ -68,7 +68,7 @@ export class CorpusService {
return this.corporaPromise;
} else {
this.corporaPromise = this.apiRetryService
.requireLogin((api) => api.corpus().toPromise())
.requireLogin((api) => lastValueFrom(api.corpus()))
.then((data) => this.parseCorpusList(data));
return this.corporaPromise;
}
Expand Down

0 comments on commit 7280eea

Please sign in to comment.