Skip to content

Commit e20a963

Browse files
committed
Fix bug with attachment URLs, make the proxy slightly more future proof
- Legacy-Id: 3825
1 parent 85b036e commit e20a963

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

ietf/liaisons/proxy.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def approval(self):
121121

122122
@property
123123
def uploads_set(self):
124-
return UploadsProxy.objects.filter(liaisonstatement=self).order_by('name')
124+
return UploadsProxy.objects.filter(liaisonstatement=self).order_by("name", "external_url")
125125

126126
@property
127127
def liaisondetail_set(self):
@@ -155,10 +155,10 @@ class UploadsProxy(Document):
155155
#file_id = models.AutoField(primary_key=True)
156156
@property
157157
def file_id(self):
158-
if self.external_url.startswith(self.name):
158+
if not self.external_url or self.external_url.startswith(self.name):
159159
return self.name # new data
160160
else:
161-
return int(self.external_url.split(".")[0][len(file):]) # old data
161+
return int(self.external_url.split(".")[0][len("file"):]) # old data
162162
#file_title = models.CharField(blank=True, max_length=255)
163163
@property
164164
def file_title(self):

0 commit comments

Comments
 (0)