Style fixes and removal of unused imports in soc.logic.models modules.
Patch by: Pawel Solyga
Reviewed by: to-be-reviewed
--- a/app/soc/logic/models/group.py Fri Apr 03 17:27:31 2009 +0000
+++ b/app/soc/logic/models/group.py Fri Apr 03 17:29:36 2009 +0000
@@ -22,7 +22,6 @@
]
-from soc.cache import sidebar
from soc.logic.models import base
import soc.models.group
--- a/app/soc/logic/models/mentor.py Fri Apr 03 17:27:31 2009 +0000
+++ b/app/soc/logic/models/mentor.py Fri Apr 03 17:29:36 2009 +0000
@@ -63,8 +63,10 @@
"""
- from soc.logic.models.student_project import logic as student_project_logic
- from soc.logic.models.student_proposal import logic as student_proposal_logic
+ from soc.logic.models.student_project import logic as \
+ student_project_logic
+ from soc.logic.models.student_proposal import logic as \
+ student_proposal_logic
fields = {'mentor': entity}
@@ -88,7 +90,8 @@
Proposals possible mentor lists.
"""
- from soc.logic.models.student_proposal import logic as student_proposal_logic
+ from soc.logic.models.student_proposal import logic \
+ as student_proposal_logic
value = entity_properties[name]
--- a/app/soc/logic/models/presence_with_tos.py Fri Apr 03 17:27:31 2009 +0000
+++ b/app/soc/logic/models/presence_with_tos.py Fri Apr 03 17:29:36 2009 +0000
@@ -23,7 +23,6 @@
from soc.logic.models import presence
-from soc.logic.models import presence as presence_logic
import soc.models.presence_with_tos
@@ -33,7 +32,7 @@
"""
def __init__(self, model=soc.models.presence_with_tos.PresenceWithToS,
- base_model=None, scope_logic=presence_logic):
+ base_model=None, scope_logic=presence):
"""Defines the name, key_name and model for this entity.
"""
--- a/app/soc/logic/models/role.py Fri Apr 03 17:27:31 2009 +0000
+++ b/app/soc/logic/models/role.py Fri Apr 03 17:29:36 2009 +0000
@@ -103,14 +103,14 @@
"""
if self.disallow_last_resign:
- # check if this is the last active role for it's scope
- fields = {'scope': entity.scope,
+ # check if this is the last active role for it's scope
+ fields = {'scope': entity.scope,
'status': 'active'}
- roles = self.getForFields(fields, limit=2)
+ roles = self.getForFields(fields, limit=2)
- # if this it the last one return error message
- if len(roles) <= 1:
- return DEF_LAST_RESIGN_ERROR_FMT
+ # if this it the last one return error message
+ if len(roles) <= 1:
+ return DEF_LAST_RESIGN_ERROR_FMT
# resignation is possible
return None
--- a/app/soc/logic/models/site.py Fri Apr 03 17:27:31 2009 +0000
+++ b/app/soc/logic/models/site.py Fri Apr 03 17:29:36 2009 +0000
@@ -22,7 +22,6 @@
]
-from soc.cache import sidebar
from soc.logic.models import presence_with_tos
import soc.models.presence_with_tos