Adding compatibility stuff for themes

During our migration to federation some interfaces were changed. We
should not have done that so fast.

Provide a compatibility layer so that old themes work
This commit is contained in:
Boris Bobrov 2016-07-31 07:17:03 +03:00
parent 06d70c4b96
commit 65805ffb0d

View File

@ -586,6 +586,16 @@ class MediaEntry(Base, MediaEntryMixin, CommentingMixin):
## TODO
# fail_error
@property
def get_uploader(self):
# for compatibility
return self.get_actor
@property
def uploader(self):
# for compatibility
return self.actor
@property
def collections(self):
""" Get any collections that this MediaEntry is in """
@ -982,6 +992,17 @@ class Comment(Base):
# When it was added
added = Column(DateTime, nullable=False, default=datetime.datetime.utcnow)
@property
def get_author(self):
# for compatibility
return self.comment().get_actor # noqa
def __getattr__(self, attr):
try:
return getattr(self.comment(), attr) # noqa
except Exception as e:
print(e)
raise
class TextComment(Base, TextCommentMixin, CommentingMixin):
"""