Skip to content

Commit 842b8f4

Browse files
committed
Merged branch/yaco/idsubmit@2903 from esanches@yaco.es to trunk: The Rewritten I-D Submission Tool.
- Legacy-Id: 3036
2 parents 69a7a73 + 153cdc7 commit 842b8f4

37 files changed

Lines changed: 2664 additions & 3 deletions

ietf/idtracker/models.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,9 @@ class InternetDraft(models.Model):
173173
idinternal = FKAsOneToOne('idinternal', reverse=True, query=models.Q(rfc_flag = 0))
174174
def __str__(self):
175175
return self.filename
176-
def save(self):
176+
def save(self, *args, **kwargs):
177177
self.id_document_key = self.title.upper()
178-
super(InternetDraft, self).save()
178+
super(InternetDraft, self).save(*args, **kwargs)
179179
def displayname(self):
180180
return self.filename
181181
def file_tag(self):

ietf/proceedings/models.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Copyright The IETF Trust 2007, All Rights Reserved
22

33
from django.db import models
4+
from django.conf import settings
45
from ietf.idtracker.models import Acronym, PersonOrOrgInfo, IRTF, AreaGroup, Area, IETFWG
56
import datetime
67
#from ietf.utils import log
@@ -149,6 +150,23 @@ def num(self):
149150
class Meta:
150151
db_table = 'meetings'
151152

153+
@classmethod
154+
def get_first_cut_off(cls):
155+
start_date = cls.objects.all().order_by('-start_date')[0].start_date
156+
offset = datetime.timedelta(days=settings.FIRST_CUTOFF_DAYS)
157+
return start_date - offset
158+
159+
@classmethod
160+
def get_second_cut_off(cls):
161+
start_date = cls.objects.all().order_by('-start_date')[0].start_date
162+
offset = datetime.timedelta(days=settings.SECOND_CUTOFF_DAYS)
163+
return start_date - offset
164+
165+
@classmethod
166+
def get_ietf_monday(cls):
167+
start_date = cls.objects.all().order_by('-start_date')[0].start_date
168+
return start_date + datetime.timedelta(days=-start_date.weekday(), weeks=1)
169+
152170
class MeetingVenue(models.Model):
153171
meeting_num = models.ForeignKey(Meeting, db_column='meeting_num', unique=True)
154172
break_area_name = models.CharField(max_length=255)

ietf/settings.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@
132132
'ietf.redirects',
133133
'ietf.idrfc',
134134
'ietf.wginfo',
135+
'ietf.submit',
135136
)
136137

137138
INTERNAL_IPS = (
@@ -192,6 +193,30 @@
192193
LIAISON_ATTACH_PATH = '/a/www/ietf-datatracker/documents/LIAISON/'
193194
LIAISON_ATTACH_URL = '/documents/LIAISON/'
194195

196+
# ID Submission Tool settings
197+
IDST_FROM_EMAIL = 'IETF I-D Submission Tool <idsubmission@ietf.org>'
198+
IDST_TO_EMAIL = 'internet-drafts@ietf.org'
199+
200+
# Days from meeting to cut off dates on submit
201+
FIRST_CUTOFF_DAYS = 5
202+
SECOND_CUTOFF_DAYS = 3
203+
204+
STAGING_PATH = '/a/www/www6s/staging/'
205+
STAGING_URL = 'http://www.ietf.org/staging/'
206+
IDNITS_PATH = '/a/www/ietf-datatracker/release/idnits'
207+
MAX_PLAIN_DRAFT_SIZE = 6291456 # Max size of the txt draft in bytes
208+
209+
# DOS THRESHOLDS PER DAY (Sizes are in MB)
210+
MAX_SAME_DRAFT_NAME = 20
211+
MAX_SAME_DRAFT_NAME_SIZE = 50
212+
MAX_SAME_SUBMITTER = 50
213+
MAX_SAME_SUBMITTER_SIZE = 150
214+
MAX_SAME_WG_DRAFT = 150
215+
MAX_SAME_WG_DRAFT_SIZE = 450
216+
MAX_DAILY_SUBMISSION = 1000
217+
MAX_DAILY_SUBMISSION_SIZE = 2000
218+
# End of ID Submission Tool settings
219+
195220
# Put SECRET_KEY in here, or any other sensitive or site-specific
196221
# changes. DO NOT commit settings_local.py to svn.
197222
from settings_local import *

ietf/submit/__init__.py

Whitespace-only changes.

ietf/submit/error_manager.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
from ietf.submit.models import IdSubmissionStatus
2+
3+
class ErrorManager(object):
4+
ERROR_CODES = {
5+
'DEFAULT': 'Unknow error',
6+
'INVALID_FILENAME': 111,
7+
'EXCEEDED_SIZE': 102,
8+
}
9+
10+
def get_error_str(self, key):
11+
error_code = self.ERROR_CODES.get(key, self.ERROR_CODES['DEFAULT'])
12+
if isinstance(error_code, basestring):
13+
return '%s (%s)' % (key, error_code)
14+
try:
15+
return IdSubmissionStatus.objects.get(status_id=error_code).status_value
16+
except IdSubmissionStatus.DoesNotExist:
17+
return '%s (%s)' % (self.ERROR_CODES['DEFAULT'], key)
18+
19+
MainErrorManager=ErrorManager()

0 commit comments

Comments
 (0)