Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions requirements/prod_20_04.pip
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ rsa==4.7.2
scandir==1.5
scikit-learn==0.21.3
scipy==1.1.0
shortuuid==1.0.11
simplegeneric==0.8.1
simplejson==3.17.2
six==1.16.0
Expand Down
8 changes: 6 additions & 2 deletions tigaserver_app/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
from django.utils.timezone import utc
from django.utils.translation import ugettext_lazy as _

from shortuuid.django_fields import ShortUUIDField

from common.translation import get_translation_in, get_locale_for_native
from tigacrafting.models import MoveLabAnnotation, ExpertReportAnnotation, Categories, STATUS_CATEGORIES
import tigacrafting.html_utils as html_utils
Expand Down Expand Up @@ -478,9 +480,11 @@ class Report(TimeZoneModelMixin, models.Model):
db_index=True,
help_text="The report version number. Should be an integer that increments by 1 for each repor version. Note that the user keeps only the most recent version on the device, but all versions are stored on the server.",
)
report_id = models.CharField(
max_length=4,
report_id = ShortUUIDField(
length=11,
unique=True,
db_index=True,
alphabet="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz-", # NOTE: safe URL characters from https://zelark.github.io/nano-id-cc/
help_text="4-digit alpha-numeric code generated on user phone to identify each unique report from that user. Digits should lbe randomly drawn from the set of all lowercase and uppercase alphabetic characters and 0-9, but excluding 0, o, and O to avoid confusion if we ever need user to be able to refer to a report ID in correspondence with MoveLab (as was previously the case when we had them sending samples).",
)

Expand Down