Remove deprecated fields and fix activity creation in tools
This commit is contained in:
parent
2e4782ef6d
commit
d2256d0b3b
@ -284,8 +284,6 @@ class User(Base, UserMixin):
|
||||
location = Column(Integer, ForeignKey("core__locations.id"))
|
||||
get_location = relationship("Location", lazy="joined")
|
||||
|
||||
activity = Column(Integer, ForeignKey("core__activity_intermediators.id"))
|
||||
|
||||
## TODO
|
||||
# plugin data would be in a separate model
|
||||
|
||||
@ -537,8 +535,6 @@ class MediaEntry(Base, MediaEntryMixin):
|
||||
media_metadata = Column(MutationDict.as_mutable(JSONEncoded),
|
||||
default=MutationDict())
|
||||
|
||||
activity = Column(Integer, ForeignKey("core__activity_intermediators.id"))
|
||||
|
||||
## TODO
|
||||
# fail_error
|
||||
|
||||
@ -907,9 +903,6 @@ class MediaComment(Base, MediaCommentMixin):
|
||||
lazy="dynamic",
|
||||
cascade="all, delete-orphan"))
|
||||
|
||||
|
||||
activity = Column(Integer, ForeignKey("core__activity_intermediators.id"))
|
||||
|
||||
def serialize(self, request):
|
||||
""" Unserialize to python dictionary for API """
|
||||
href = request.urlgen(
|
||||
@ -990,8 +983,6 @@ class Collection(Base, CollectionMixin):
|
||||
backref=backref("collections",
|
||||
cascade="all, delete-orphan"))
|
||||
|
||||
activity = Column(Integer, ForeignKey("core__activity_intermediators.id"))
|
||||
|
||||
__table_args__ = (
|
||||
UniqueConstraint('creator', 'slug'),
|
||||
{})
|
||||
|
@ -72,10 +72,10 @@ def create_activity(verb, obj, actor, target=None, generator=None):
|
||||
generator.save()
|
||||
|
||||
activity = Activity(verb=verb)
|
||||
activity.set_object(obj)
|
||||
activity.object = obj
|
||||
|
||||
if target is not None:
|
||||
activity.set_target(target)
|
||||
activity.target = target
|
||||
|
||||
# If they've set it override the actor from the obj.
|
||||
activity.actor = actor.id if isinstance(actor, User) else actor
|
||||
|
Loading…
x
Reference in New Issue
Block a user