Commit c426f550 by Will Daly

Respond to code review feedback.

parent cea06e12
...@@ -267,8 +267,6 @@ def create_credit_request(course_key, provider_id, username): ...@@ -267,8 +267,6 @@ def create_credit_request(course_key, provider_id, username):
if created: if created:
credit_request.uuid = uuid.uuid4().hex credit_request.uuid = uuid.uuid4().hex
else:
credit_request.timestamp = datetime.datetime.now(pytz.UTC)
# Retrieve user account and profile info # Retrieve user account and profile info
user = User.objects.select_related('profile').get(username=username) user = User.objects.select_related('profile').get(username=username)
...@@ -291,7 +289,7 @@ def create_credit_request(course_key, provider_id, username): ...@@ -291,7 +289,7 @@ def create_credit_request(course_key, provider_id, username):
parameters = { parameters = {
"request_uuid": credit_request.uuid, "request_uuid": credit_request.uuid,
"timestamp": to_timestamp(credit_request.timestamp), "timestamp": to_timestamp(datetime.datetime.now(pytz.UTC)),
"course_org": course_key.org, "course_org": course_key.org,
"course_num": course_key.course, "course_num": course_key.course,
"course_run": course_key.run, "course_run": course_key.run,
......
...@@ -14,7 +14,6 @@ from django.core.validators import RegexValidator ...@@ -14,7 +14,6 @@ from django.core.validators import RegexValidator
from simple_history.models import HistoricalRecords from simple_history.models import HistoricalRecords
from jsonfield.fields import JSONField from jsonfield.fields import JSONField
from util.date_utils import to_timestamp
from model_utils.models import TimeStampedModel from model_utils.models import TimeStampedModel
from xmodule_django.models import CourseKeyField from xmodule_django.models import CourseKeyField
from django.utils.translation import ugettext_lazy from django.utils.translation import ugettext_lazy
...@@ -343,7 +342,6 @@ class CreditRequest(TimeStampedModel): ...@@ -343,7 +342,6 @@ class CreditRequest(TimeStampedModel):
username = models.CharField(max_length=255, db_index=True) username = models.CharField(max_length=255, db_index=True)
course = models.ForeignKey(CreditCourse, related_name="credit_requests") course = models.ForeignKey(CreditCourse, related_name="credit_requests")
provider = models.ForeignKey(CreditProvider, related_name="credit_requests") provider = models.ForeignKey(CreditProvider, related_name="credit_requests")
timestamp = models.DateTimeField(auto_now_add=True)
parameters = JSONField() parameters = JSONField()
REQUEST_STATUS_PENDING = "pending" REQUEST_STATUS_PENDING = "pending"
...@@ -393,7 +391,7 @@ class CreditRequest(TimeStampedModel): ...@@ -393,7 +391,7 @@ class CreditRequest(TimeStampedModel):
return [ return [
{ {
"uuid": request.uuid, "uuid": request.uuid,
"timestamp": to_timestamp(request.modified), "timestamp": request.parameters.get("timestamp"),
"course_key": request.course.course_key, "course_key": request.course.course_key,
"provider": { "provider": {
"id": request.provider.provider_id, "id": request.provider.provider_id,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment