Skip to content

Commit

Permalink
update ocm
Browse files Browse the repository at this point in the history
  • Loading branch information
imwhatiam committed Jul 8, 2024
1 parent d982009 commit 40cdedd
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions seahub/api2/endpoints/ocm.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from seaserv import seafile_api

from seahub.utils.repo import get_available_repo_perms, get_repo_owner
from seahub.base.templatetags.seahub_tags import email2nickname
from seahub.base.templatetags.seahub_tags import email2nickname, email2contact_email
from seahub.constants import PERMISSION_READ, PERMISSION_READ_WRITE

from seahub.profile.models import Profile
Expand Down Expand Up @@ -367,16 +367,15 @@ def post(self, request):
consumer_protocol = get_remote_protocol(to_server_url + OCM_PROTOCOL_URL)

shared_secret = gen_shared_secret()
from_user = username
post_data = {
'shareWith': to_user,
'name': repo.repo_name,
'description': '',
'providerId': OCM_PROVIDER_ID,
'owner': repo_owner,
'sender': from_user,
'sender': email2contact_email(username),
'ownerDisplayName': email2nickname(repo_owner),
'senderDisplayName': email2nickname(from_user),
'senderDisplayName': email2nickname(username),
'shareType': consumer_protocol['resourceTypes']['shareTypes'][0], # currently only support user type
'resourceType': consumer_protocol['resourceTypes']['name'], # currently only support repo
'protocol': {
Expand Down

0 comments on commit 40cdedd

Please sign in to comment.