Browse Source

Changed the returned value in case of failure on the update rank query in LeRelation

Roland Haroutiounian 9 years ago
parent
commit
b8b9914567
1 changed files with 1 additions and 2 deletions
  1. 1
    2
      DataSource/MySQL/leapidatasource.py

+ 1
- 2
DataSource/MySQL/leapidatasource.py View File

@@ -409,7 +409,6 @@ class LeDataSourceSQL(DummyDatasource):
409 409
     # @param id_relation int: relation ID
410 410
     # @param rank int|str|tuple : 'first', 'last', an integer value or a (operator, value) tuple (for the shifting)
411 411
     # @throw leapi.leapi.LeObjectQueryError if id_relation doesn't exist
412
-    # @throw RuntimeError if the query failed
413 412
     #
414 413
     # TODO Conserver cette méthode dans le datasource du fait des requêtes SQL. Elle est appelée par le set_rank de LeRelation
415 414
     def update_rank(self, id_relation, rank):
@@ -447,7 +446,7 @@ class LeDataSourceSQL(DummyDatasource):
447 446
         sql = insert(MySQL.relations_table_name, columns=(MySQL.relations_pkname, 'rank'), values=rdatas, on_duplicate_key_update={'rank', mosql.util.raw('VALUES(`rank`)')})
448 447
         with self.connection as cur:
449 448
             if cur.execute(sql) != 1:
450
-                raise RuntimeError("Unknow SQL error")
449
+                return False
451 450
             else:
452 451
                 return True
453 452
 

Loading…
Cancel
Save