Commit 40b8bbc6 authored by Guillaume Mella's avatar Guillaume Mella
Browse files

handle duplicated entries

parent 5eeebb85
......@@ -205,7 +205,11 @@ class StarInfo(Base):
def is_unique(self):
q = self.session.query(StarInfo).filter_by(id1=self.id1, id2=self.id2, ud_diam=self.ud_diam, ld_diam=self.ld_diam, e_ld_diam=self.e_ld_diam).count()
# same id1, mesurements, bibcodes
q = self.session.query(StarInfo).filter_by(id1=self.id1, ud_diam=self.ud_diam, ld_diam=self.ld_diam, e_ld_diam=self.e_ld_diam, bibcode=self.bibcode).count()
print("is_unique query returns : %s"%q)
if q > 0:
self.append_entry_error('star entry already present in the catalog (same id1, ud_diam, ld_diam and bibcode)')
return not q
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment