Changeset View
Changeset View
Standalone View
Standalone View
swh/deposit/models.py
Show First 20 Lines • Show All 145 Lines • ▼ Show 20 Lines | def __str__(self): | ||||
'client': self.client.username, | 'client': self.client.username, | ||||
'status': self.status, | 'status': self.status, | ||||
} | } | ||||
if self.status in (DEPOSIT_STATUS_REJECTED): | if self.status in (DEPOSIT_STATUS_REJECTED): | ||||
d['status_detail'] = self.status_detail | d['status_detail'] = self.status_detail | ||||
return str(d) | return str(d) | ||||
@property | |||||
def origin_url(self): | |||||
return '%s/%s' % (self.client.provider_url.rstrip('/'), | |||||
self.external_id) | |||||
def client_directory_path(instance, filename): | def client_directory_path(instance, filename): | ||||
"""Callable to upload archive in MEDIA_ROOT/user_<id>/<filename> | """Callable to upload archive in MEDIA_ROOT/user_<id>/<filename> | ||||
Args: | Args: | ||||
instance (DepositRequest): DepositRequest concerned by the upload | instance (DepositRequest): DepositRequest concerned by the upload | ||||
filename (str): Filename of the uploaded file | filename (str): Filename of the uploaded file | ||||
▲ Show 20 Lines • Show All 62 Lines • Show Last 20 Lines |