mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2024-11-15 01:05:42 +00:00
small fix
This commit is contained in:
parent
0609e2cd72
commit
cb31afe723
@ -775,13 +775,16 @@ class User(HashidMixin, UserMixin, db.Model):
|
||||
#endregion Profile Privacy settings
|
||||
|
||||
def follow_corpus(self, corpus, role=None):
|
||||
if self.is_following_corpus(corpus):
|
||||
return
|
||||
if role is None:
|
||||
r = CorpusFollowerRole.query.filter_by(default=True).first()
|
||||
cfa = CorpusFollowerAssociation(corpus=corpus, role=r, follower=self)
|
||||
db.session.add(cfa)
|
||||
|
||||
def unfollow_corpus(self, corpus):
|
||||
if self.is_following_corpus(corpus):
|
||||
if not self.is_following_corpus(corpus):
|
||||
return
|
||||
self.followed_corpora.remove(corpus)
|
||||
|
||||
def is_following_corpus(self, corpus):
|
||||
|
Loading…
Reference in New Issue
Block a user