mirror of
https://github.com/haiwen/seahub.git
synced 2025-08-31 06:34:40 +00:00
add index to UserStarredFile
This commit is contained in:
@@ -157,7 +157,7 @@ class UserStarredFiles(models.Model):
|
||||
|
||||
email = models.EmailField()
|
||||
org_id = models.IntegerField()
|
||||
repo_id = models.CharField(max_length=36)
|
||||
repo_id = models.CharField(max_length=36, db_index=True)
|
||||
|
||||
path = models.TextField()
|
||||
is_dir = models.BooleanField()
|
||||
|
@@ -688,7 +688,10 @@ def star_file(email, repo_id, path, is_dir, org_id=-1):
|
||||
repo_id=repo_id,
|
||||
path=path,
|
||||
is_dir=is_dir)
|
||||
f.save()
|
||||
try:
|
||||
f.save()
|
||||
except IntegrityError, e:
|
||||
logger.warn(e)
|
||||
|
||||
def unstar_file(email, repo_id, path):
|
||||
# Should use "get", but here we use "filter" to fix the bug caused by no
|
||||
|
Reference in New Issue
Block a user