2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2024-11-22 07:11:52 +00:00

adding sync to databaseRest and cleaning a template

This commit is contained in:
Philip Sargent 2020-04-19 23:35:41 +01:00
parent b123f6ada7
commit 0b85a9d330
2 changed files with 13 additions and 4 deletions

View File

@ -36,6 +36,15 @@ def reload_db():
user.is_superuser = True
user.save()
def syncuser():
"""Sync user - needed after reload"""
management.call_command('syncdb', interactive=False)
user = User.objects.create_user(expouser, expouseremail, expouserpass)
user.is_staff = True
user.is_superuser = True
user.save()
def make_dirs():
"""Make directories that troggle requires"""
#should also deal with permissions here.
@ -147,7 +156,7 @@ class JobQueue():
self.results_order=[
"date","runlabel","reload", "caves", "people",
"logbooks", "scans", "QMs", "survex",
"tunnel", "surveys", "test", "makedirs", "redirect" ]
"tunnel", "surveys", "test", "makedirs", "redirect", "syncuser" ]
for k in self.results_order:
self.results[k]=[]
self.tfile = "import_profile.json"
@ -253,6 +262,7 @@ def usage():
writecaves - *disabled* (archaic?)
autologbooks - read in autologbooks (what are these?)
dumplogbooks - write out autologbooks (not working?)
syncuser - needed after reloading database rom SQL backup
test - testing...
and [runlabel] is an optional string identifying this run of the script

View File

@ -6,14 +6,13 @@
{% block content %}
<h3>All Tunnel files</h3>
<h3>All Tunnel files - references to wallets and survey scans</h3>
<table>
<tr><th>File</th><th>Font</th><th>SurvexBlocks</th><th>Size</th><th>Paths</th><th>Scans folder</th><th>Scan files</th><th>Frames</th></tr>
<tr><th>File</th><th>Font</th><th>Size</th><th>Paths</th><th>Scans folder</th><th>Scan files</th><th>Frames</th></tr>
{% for tunnelfile in tunnelfiles %}
<tr>
<td><a href="{% url "tunnelfile" tunnelfile.tunnelpath %}">{{tunnelfile.tunnelpath}}</a></td>
<td>{{tunnelfile.bfontcolours}}</td>
<td></td>
<td>{{tunnelfile.filesize}}</td>
<td>{{tunnelfile.npaths}}</td>