mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-01-23 19:36:56 -08:00
save name of user or community when creating notification subscription #20
This commit is contained in:
parent
708edd51b6
commit
a1442afaf5
2 changed files with 4 additions and 2 deletions
|
@ -1173,7 +1173,8 @@ def community_notification(community_id: int):
|
|||
db.session.commit()
|
||||
else: # no subscription yet, so make one
|
||||
if not community.user_is_banned(current_user):
|
||||
new_notification = NotificationSubscription(user_id=current_user.id, entity_id=community.id, type=NOTIF_COMMUNITY)
|
||||
new_notification = NotificationSubscription(name=community.title, user_id=current_user.id, entity_id=community.id,
|
||||
type=NOTIF_COMMUNITY)
|
||||
db.session.add(new_notification)
|
||||
db.session.commit()
|
||||
|
||||
|
|
|
@ -233,7 +233,8 @@ def user_notification(user_id: int):
|
|||
db.session.commit()
|
||||
else: # no subscription yet, so make one
|
||||
if user.id != current_user.id and not user.has_blocked_user(current_user.id):
|
||||
new_notification = NotificationSubscription(user_id=current_user.id, entity_id=user.id, type=NOTIF_USER)
|
||||
new_notification = NotificationSubscription(name=user.display_name(), user_id=current_user.id,
|
||||
entity_id=user.id, type=NOTIF_USER)
|
||||
db.session.add(new_notification)
|
||||
db.session.commit()
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue