Pclanglais commited on
Commit
ebd0c9c
·
verified ·
1 Parent(s): 09967d8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -7
app.py CHANGED
@@ -111,13 +111,14 @@ def create_bibtex_entry(data):
111
  if year and 'year' not in data:
112
  data['year'] = year
113
 
114
- match_year = re.search(r'(\d{4})', data['year'])
115
-
116
- if match_year:
117
- data['year'] = match_year.group(1)
118
- year = data['year']
119
- else:
120
- data.pop('year', '')
 
121
 
122
  #Pages conformity.
123
  if 'pages' in data:
 
111
  if year and 'year' not in data:
112
  data['year'] = year
113
 
114
+ if "year" in data:
115
+ match_year = re.search(r'(\d{4})', data['year'])
116
+
117
+ if match_year:
118
+ data['year'] = match_year.group(1)
119
+ year = data['year']
120
+ else:
121
+ data.pop('year', '')
122
 
123
  #Pages conformity.
124
  if 'pages' in data: