Skip to content

Commit

Permalink
Merge pull request apluslms#97 from Rubinous/removing_encode_id_and_d…
Browse files Browse the repository at this point in the history
…ecode_id

Removed encode_id and decode_id methods
  • Loading branch information
vkaravir committed Feb 27, 2013
2 parents cf2a5be + a51be80 commit 7e79f56
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 31 deletions.
10 changes: 5 additions & 5 deletions apps/app_renderers.py
Expand Up @@ -105,7 +105,7 @@ def _build_src(self):
}

for k, v in self.context.items():
params[k + "_id"] = v.encode_id()
params[k + "_id"] = v.id

return update_url_params(self.plugin.service_url, params)

Expand Down Expand Up @@ -135,8 +135,8 @@ def __init__(self, tab, user_profile, course_instance):

def _build_src(self):
params = {
"course_instance_id": self.course_instance.encode_id(),
"user_profile_id": self.user_profile.encode_id()
"course_instance_id": self.course_instance.id,
"user_profile_id": self.user_profile.id
}

return update_url_params(self.tab.content_url, params)
Expand All @@ -158,8 +158,8 @@ def __init__(self, tab, user_profile, course_instance):

def _build_src(self):
params = {
"course_instance_id": self.course_instance.encode_id(),
"user_profile_id": self.user_profile.encode_id()
"course_instance_id": self.course_instance.id,
"user_profile_id": self.user_profile.id
}

return update_url_params(self.tab.content_url, params)
Expand Down
4 changes: 0 additions & 4 deletions course/models.py
Expand Up @@ -116,10 +116,6 @@ class CourseInstance(models.Model):
plugins = generic.GenericRelation(BasePlugin, object_id_field="container_pk", content_type_field="container_type")
tabs = generic.GenericRelation(BaseTab, object_id_field="container_pk", content_type_field="container_type")

def encode_id(self):
# TODO: Encode using settings.SECRET_KEY
return self.id

def is_assistant(self, profile):
"""
Returns True if the given profile belongs to an assistant on this course instance.
Expand Down
8 changes: 0 additions & 8 deletions exercise/exercise_models.py
Expand Up @@ -171,14 +171,6 @@ class BaseExercise(LearningObject):
max_submissions = models.PositiveIntegerField(default=10)
max_points = models.PositiveIntegerField(default=100)
points_to_pass = models.PositiveIntegerField(default=40)


def decode_id(self, enc_id):
return enc_id

def encode_id(self):
# TODO: encode with settings.SECRET_KEY
return self.id

def get_page(self, submission_url):
"""
Expand Down
7 changes: 0 additions & 7 deletions exercise/submission_models.py
Expand Up @@ -112,13 +112,6 @@ def check_user_permission(self, profile):

return False

def decode_id(self, enc_id):
return enc_id

def encode_id(self):
# TODO: encode with settings.SECRET_KEY
return self.id

def get_course(self):
return self.get_course_instance().course

Expand Down
7 changes: 0 additions & 7 deletions userprofile/models.py
Expand Up @@ -19,13 +19,6 @@ def _generate_gravatar_url(self):
return "http://www.gravatar.com/avatar/" + hash +"?d=identicon"
avatar_url = property(_generate_gravatar_url)

def decode_id(self, enc_id):
return enc_id

def encode_id(self):
# TODO: encode with settings.SECRET_KEY
return self.id

def get_shortname(self):
"""
Returns a short version of the user's name, with the first name and the first letter
Expand Down

0 comments on commit 7e79f56

Please sign in to comment.