to E: or not to E:
This commit is contained in:
parent
b801c52847
commit
8997e05128
2 changed files with 22 additions and 3 deletions
|
|
@ -79,6 +79,12 @@ class Text(models.Model):
|
|||
user = self.data.get('user', None)
|
||||
if user:
|
||||
annotations = list(filter(lambda annot: annot['user'] == user, annotations))
|
||||
if self.data.get('only_e'):
|
||||
annotations = [e for e in annotations if e['value'].startswith('E:')]
|
||||
for e in annotations:
|
||||
e['value'] = e['value'][2:].strip()
|
||||
else:
|
||||
annotations = [e for e in annotations if not e['value'].startswith('E:')]
|
||||
return self.get_clips(api, annotations)
|
||||
|
||||
def get_edit_annotations(self, api):
|
||||
|
|
@ -101,7 +107,7 @@ class Text(models.Model):
|
|||
if annotation['value'].startswith('E:'):
|
||||
annotation['value'] = annotation['value'][2:].strip()
|
||||
annotations.append(annotation)
|
||||
else:
|
||||
elif not annotation['value'].startswith('E:'):
|
||||
annotations.append(annotation)
|
||||
return self.get_clips(api, annotations)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue