Browse Source

Encore des correction

Driky 10 years ago
parent
commit
d5baff9249
1 changed files with 3 additions and 3 deletions
  1. 3
    3
      EditorialModel/components.py

+ 3
- 3
EditorialModel/components.py View File

172
                     c.close()
172
                     c.close()
173
                     if(res != None):
173
                     if(res != None):
174
                         if(new_rank < self.rank):
174
                         if(new_rank < self.rank):
175
-                            req = req.where(getattr(component.c, self.ranked_in) == getattr(self, self.ranked_in) and (component.c.rank >= new_rank))
175
+                            req = req.where(getattr(component.c, self.ranked_in) == getattr(self, self.ranked_in) and component.c.rank >= new_rank and component.c.rank < self.rank)
176
                         else:
176
                         else:
177
-                            req = req.where(getattr(component.c, self.ranked_in) == getattr(self, self.ranked_in) and (component.c.rank <= new_rank ))
177
+                            req = req.where(getattr(component.c, self.ranked_in) == getattr(self, self.ranked_in) and component.c.rank <= new_rank and component.c.rank > self.rank)
178
 
178
 
179
                         c = dbe.connect()
179
                         c = dbe.connect()
180
                         res = c.execute(req)
180
                         res = c.execute(req)
245
                         raise ValueError('Excepted a positive int not a null. new_rank = '+str((new_rank)))
245
                         raise ValueError('Excepted a positive int not a null. new_rank = '+str((new_rank)))
246
                 else:
246
                 else:
247
                     logger.error("Bad argument")
247
                     logger.error("Bad argument")
248
-                    raise TypeError('Excepted a string (\'=\' or \'+\' or \'-\') not a '+str(type(new_rank)))
248
+                    raise TypeError('Excepted a string (\'=\' or \'+\' or \'-\') not a '+str((new_rank)))
249
             else:
249
             else:
250
                 logger.error("Bad argument")
250
                 logger.error("Bad argument")
251
                 raise ValueError('Excepted a positive int not a negative. new_rank = '+str((new_rank)))
251
                 raise ValueError('Excepted a positive int not a negative. new_rank = '+str((new_rank)))

Loading…
Cancel
Save