another small fix

This commit is contained in:
Patrick Jentsch 2023-02-24 09:46:35 +01:00
parent cb31afe723
commit 122cce98a1

View File

@ -777,8 +777,7 @@ class User(HashidMixin, UserMixin, db.Model):
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()
r = CorpusFollowerRole.query.filter_by(default=True).first() if role is None else role
cfa = CorpusFollowerAssociation(corpus=corpus, role=r, follower=self)
db.session.add(cfa)